使用SphinxQl
,在执行此查询时,我收到以下错误
select fieldname from indexname where height >= 165.25 and height <= 175.25 OR Age >=51;
ERROR 1064 (42000): sphinxql: syntax error, unexpected OR, expecting $end near 'OR Age >=51'
select fieldname from indexname where (height >= 165.25 and height <= 175.25) OR Age >=51;
ERROR 1064 (42000): sphinxql: only >=, <=, and BETWEEN floating-point filter types are supported in this version near '(height >= 165.25 and height <= 175.25) OR Age >=51'
预先谢谢,请建议
答案 0 :(得分:1)
尝试类似
的内容SELECT fieldname, IF( (height >= 165.25 AND height <= 175.25) OR Age >=51, 1, 0)
AS myfilter FROM indexname WHERE myfilter = 1
Sphinx可以执行'OR',它们实际上不能在WHERE子句中。