首頁  >  文章  >  後端開發  >  coreseek 或者 sphinx 中想要搜索范围咋整?

coreseek 或者 sphinx 中想要搜索范围咋整?

WBOY
WBOY原創
2016-06-06 20:52:321100瀏覽

如题,比如我要搜索一个字段 $col > 10。
貌似不支持这样的语法,不知道应该怎么弄。请高人指点。多谢

回复内容:

如题,比如我要搜索一个字段 $col > 10。
貌似不支持这样的语法,不知道应该怎么弄。请高人指点。多谢

php 到接口中有
$sphinxobject->SetFilterRange($col, 10, 1000);
是查找 10到 1000 可以代替一下

//public bool SphinxClient::setFilterRange ( string $attribute , int $min , int $max [, bool $exclude = false ] )
$sphinxobject->SetFilterRange($col, 0, 10, true);

可以考虑使用SphinxQl,where col > 10

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn