I am new to Sphinx and trying to configure it correctly. I want to allow partial word matching for all searches, and I donβt want users to enter wildcards on their own.
I want the search to work either on Amazon or Google, where if you start typing, sentences will come. So, for example, if someone typed βx,β then characters like βXboxβ should appear.
Here are the index settings that I currently have:
min_word_len = 1 min_prefix_len = 1 prefix_fields = name charset_type = utf-8
On the PHP side, I use SPH_MATCH_EXTENDED2 and SPH_SORT_RELEVANCE . I left the default ranking mode, whatever that is. These settings seemed to provide the best search results when I changed the settings based on trial and error.
I read similar questions here and on other sites, but the answers always seem to refer to enable_star , which the documentation says is not recommended.
So my question is: how do I enable partial word matches in Sphinx? Should I just add * to each word in a user request, doing something like this?
$search = str_replace(' ', '* ', trim($search)) + '*';
source share