Home  >  Article  >  Backend Development  >  coreseek 或者 sphinx 中想要搜索范围咋整?

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

WBOY
WBOYOriginal
2016-06-06 20:52:321100browse

如题,比如我要搜索一个字段 $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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn