symphonists / search_index

Search Index provides an easy way to implement high performance fulltext searching on your Symphony site
32 stars 21 forks source link

mb_strpos(): Offset not contained in string #65

Open mprofitlich opened 3 years ago

mprofitlich commented 3 years ago

I sometimes got the PHP error _mbstrpos(): Offset not contained in string. I cannot find out when it happens and when not.

There’s an old thread from 2012 on the Symphony forum in which Nikolai Shmakov gives a solution that also works for me:

Replace line 383 in class.search_index_php $p = $match[0][1]; against $p = $match[0][1]/2;

animaux commented 3 years ago

I think I used that too some time ago. But if I remember correctly, the side-effect was that the extracts were offset from the actual keywords.

mprofitlich commented 3 years ago

That’s true. The results are still correct but the extract shown often doesn’t show the keyword (which is there but at another place in the text). How did you solve or circumvent the problem?

animaux commented 3 years ago

¯\_(ツ)_/¯