gyaani_guy
gyaani_guy

Reputation: 3209

How exactly is the regexp_filter index option supposed to be used in sphinx.conf?

Not sure how exactly the regexp option is to be used.
What I want: That words like ['wick','wicks'] and ['television',''televisions'] give the same search results.

This is what I tried:

regexp_filter = (?i)\b([^\s]+?[^es])s\b => \1

After using this television matches televisions, but televisions doesn't match anything! Which is quite strange..
I also tried

regexp_filter = (?i)\b([^\s]+?[^es])s\b => \1s

which was like not having this filter at all..(television matched only television, televisions matched only televisions)

Sphinx Version 2.2.8
Installed Re2
Debian Squeeze

Upvotes: 0

Views: 208

Answers (1)

gyaani_guy
gyaani_guy

Reputation: 3209

Edit: Not quite. The regexp filter

regexp_filter = (?i)\b([^\s]+?[^es])s\b => \1s \1

makes 'words' -> match 'words' and 'word' . However 'word' still doesn't match 'words' :(


I figured it out! again..

What I had to do was use both \1s and \1 , so 'word' matches both 'word' and 'words'

regexp_filter = (?i)\b([^\s]+?[^es])s\b => \1s \1

Got this info from here http://gotoanswer.stanford.edu/?q=Configure+Sphinx+to+handle+space+as+possible+words+separator

Upvotes: 1

Related Questions