S
S
simonnik2014-04-28 12:06:47
Sphinx
simonnik, 2014-04-28 12:06:47

How to specify a string value in setFilter?

According to the API, SetFilter - for some reason unknown to me, accepts only numbers as values.
Accordingly, then what is the correct way to execute the request?

$sphinx->SetFilter('gender', array('male'));
$sphinx->Query('человек', '*');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
simonnik, 2014-04-28
@simonnik

Understood. Who cares:
in the sphinx config we write something like:

SELECT id, CRC32(user_type) AS user_type \
        FROM users
sql_attr_uint    = user_type

and in code
$this->sphinxClient->SetFilter('user_type', array(crc32('admin'));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question