S
S
sajgak2011-05-14 22:46:38
Sphinx
sajgak, 2011-05-14 22:46:38

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

4 answer(s)
S
Shedar, 2011-05-15
@Shedar

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.

Y
Yanovsky, 2013-10-29
@Yanovsky

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

F
flypigs, 2011-05-14
@flypigs

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

N
niko83, 2011-05-16
@niko83

if I understand correctly, then this is what you need
sphinxsearch.com/docs/current.html#conf-sql-attr-string

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question