I
I
Ilya Malinovsky2019-12-26 23:38:32
PHP
Ilya Malinovsky, 2019-12-26 23:38:32

How to make Sphinx filter on negative values?

Good afternoon!
On one of the projects, I decided to use Sphinx to build filtering, sorting and searching for goods. Everything was fine, but then there was a problem, one of the parameters, which is displayed on the front as a range slider, can take negative values. When building a config, I use this property as sql_attr_uint and, as the name implies, the field can only contain positive integer values. As a result, the filter began to fail, after a little searching, I realized that it would not be possible to set a negative number in sphinx, much less to filter by it. How to be in such a situation? I use the PHP sphinx library, but I will consider the option on the usual SphinxQL

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
neol, 2019-12-27
@neol

Isn't sql_attr_bigint suitable? Judging by the documentation, this type is signed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question