Sivanath
Sivanath

Reputation: 559

Sphinx search from text with special characters

Please help me on sphinx search with extended search mode - I need to find "fathers day" query string from "Today is fathers's day" text. While searching, this text was ignored because of single quote in it. Is there any way to retrieve this?

Upvotes: 0

Views: 793

Answers (1)

barryhunter
barryhunter

Reputation: 21091

If really talking about father's, (ie fathers's is just a typo in your post); one possibility, is to add quote to ignore_chars

http://sphinxsearch.com/docs/current.html#conf-ignore-chars

During indexing it will 'disappear', so Today is father's day would simply be indexed as Today is fathers day


Really dealing with fathers's is a more tricky. Possibly fix it up with regexp_filter.

regexp_filter = (\w)s's\b => \1s

May want to combine this with morphology - ie a stemmer. http://sphinxsearch.com/docs/current.html#conf-morphology

Upvotes: 2

Related Questions