Answer the question
In order to leave comments, you need to log in
Sphinx select from results by attribute value?
Good time.
There was a need to take into account the value of a certain string attribute (not to be confused with a field) when searching. That is, select only those results whose string attribute is equal to the given value.
I looked in the documentation of the latest version, I did not see anything. I would be grateful for any hint.
Thanks
Answer the question
In order to leave comments, you need to log in
Based on your description, you should rather index this attribute as a text field, with the exact word form indexing mode turned on, and look for an exact match in this field when searching.
In general, the sphinx is optimized for full-text search, so at one of the conferences Andrei Aksenov recommended replacing even highly selective numeric attributes with special. keywords, since the search for attributes is a fullscan.
You need to apply the method setFilter(string $attributeName, array $values, boolean $exclude);
True filtering is possible only by integer values. As an option, calculate crc32 from a string and write it as an additional attribute
Take a look here sphinxsearch.com/forum/view.html?id=5710 In
general, the forum at the sphinx is full of all sorts of solutions
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question