2013-03-04 113 views
0

使用SphinxQl,而執行這個查詢,我收到以下錯誤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

'OR'在SphinxQL中不受支持 – 2013-03-04 12:27:15

+0

對於這種情況,如何在sphinxQL中進行查詢?請告知 – karthik 2013-03-04 13:03:16

+0

這沒有好的解決方案。你唯一能做的就是向Sphinx發起兩次查詢,並且自己將它們加入代碼中 – 2013-03-05 10:16:31

回答

1

試着這麼做

SELECT fieldname, IF((height >= 165.25 AND height <= 175.25) OR Age >=51, 1, 0) 
AS myfilter FROM indexname WHERE myfilter = 1 

獅身人面像可以做'或',他們實際上不能在WHERE子句本身。