D
D
DeusModus2010-11-04 11:25:52
Sphinx
DeusModus, 2010-11-04 11:25:52

Sphinx: limiting output using REGEXP (or rules)

The question arose - is it possible to limit the issuance using a regular expression?
Example - "Some terrible line with TTX600MXP" or "Another line 700PX" or "Another line YYY2000".
The search takes place on "600". If I search in the "it doesn't matter what is left or right" mode *600*, then I also get in the results: 1600, 6001, ..., and somewhere below what I need.
Is it possible on the sphinx side to search for [A-zA-z]600[A-zA-z] and issue "TTX600", "600W", "RPM600GHY". That is, records in which there are letters to the left or right of the number.

PS: I read the documentation, but this issue is somehow not covered there. English-language forums seem to advise you to programmatically solve this, but when there are a couple of thousand results in the search results, this is unprofitable.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DeusModus, 2010-11-06
@DeusModus

I solved the problem by adding an extra column to the table on which the index is built.
In this column I write down all additional combinations.

S
Sergey, 2010-11-06
@seriyPS

No, you cannot use regular expressions in Sphinx.
There is a certain search query language sphinxsearch.com/docs/current.html#boolean-syntax but regular expressions cannot be used directly

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question