Why does sphinx 3.4.1 return zeros when creating a query via SetSelect()

49 Views Asked by At

I am using sphinx 3.4.1 and php 7.4. I have a sql_attr_multi field and when I filter its data through setFilterRange(), the data is returned correct However, if I do this via setSelect(), for example

$sphinx->setSelect(
    "*, IF(((field>= {$min} and field <={$max}) OR (field>= {$min1} and field <={$max1})), 1, 0) as fromField"
);
$sphinx->setFilter('fromField', [1]);

then the objects of the field field come as '0', which is why I get data only if $min = 0.

Even without using 'OR' I get the same results

$sphinx->setSelect(
    "*, IF(((field>= {$min} and field <={$max})), 1, 0) as fromField"
);

I need to filter this field with the logical operator 'OR'.

I'm not sure if the problem is part of the sql_attr_multi field, because for the sql_attr_uint field, this sort works

0

There are 0 best solutions below