I’m using Sphinx 2.2.11 (haven’t yet migrated to Manticore), and I’m having issues with using the wordforms feature in addition to a prefix search (i.e., term expansion).
In my specific use case, I apply term expansion to all query terms. In other words, I append a star (asterisk) to the end of every search term as part of my query parsing. This happens before the query is sent to Sphinx.
Here’s an example:
Let’s say my wordforms file has the following entry:
US > United States
My document has the term:
My users, knowing that all terms are expanded automatically, will assume that a search for
US will match
USA. However, this doesn’t happen.
Let’s look at how the query is parsed:
My custom query parser will lookup the term in the wordforms file. It finds the term “US”, and then it takes the right-hand term “United States”, and transforms it into the following query to send to Sphinx:
(United States*|United States)
Based on how Sphinx works, this query will not match my document. Only the right-hand term in the wordforms file is used in the term expansion. That’s because this is the term that is substituted for
US in both the document as well as the query. But my users expect that their query will be transformed into:
Is there a way I can take advantage of the wordforms feature while also allowing term expansion to function on the original search term, and not only on the right-hand wordforms entry?
Thanks a lot for any tips!