splittingred/SimpleSearch — Issue #62: createExtract function returns wrong extract
Author: lrscj
Created: 2012-02-01 12:55:58+00:00
State: open

I have searched for a word using also highlighting feature, but the extracted text does not contain the searched word.
I got into the source code, and I found out, thet $pos_start is computed wrong; most cases starts from zero which is wrong as the word is somewhere further in text.

Also, $extract is wrong;
this line from snippet $extract = array_pop($search->searchArray); clears the searched words and it can not highlight anymore the text; only first N resources are highlighted, where N is the number of words to search, and each word is highlighed in only one resurce content.
This final bug is introduced recently; it was not in previous versions.