I am using regexp_filter in Sphinx to replace terms
In most cases I can do so e.g. misspellings are easy:
regexp_filter = Backround => Background
Even swapping using capturing group notation:
regexp_filter = (Left)(Right) => \2\1
However I am having more trouble when using a pattern match to find a given words I want to replace:
regexp_filter = (PatternWord1|PatternWord2)\W+(?:\w+\W+){1,6}?(SearchTerm)\b => NewSearchTerm
Where NewSearchTerm would be the term I want to replace just \2 with (leaving \1 and the rest of the pattern alone). So
So if I had text 'Pizza and Taco Parlor'
then:
regexp_filter = (Pizza)\W+(?:\w+\W+){1,6}?(Parlor)\b => Store
Would convert to 'Pizza and Taco Store'
I know in this case the SearchTerm is /2 but not sure how to convert. I know I could append e.g. /2s to make it plural but how can I in fact replace it since it is just a single capturing group of several and I just want to replace that group?