Home  >  Article  >  Backend Development  >  sphinx搜索词为空不能使用吗?

sphinx搜索词为空不能使用吗?

WBOY
WBOYOriginal
2016-06-06 20:23:111338browse

<code>$cl = new SphinxClient();
$cl->Query("'关键词'",'test1');
</code>

我在使用sphinx,发现很好用,但是关键词为空的时候,他就无法搜索出来数据了。

例如Mysql like %关键词% 查询,为空的时候就获取所有的了。

当关键词为空的时候,到底还能使用sphinx吗,或者直接拉取完所有ID出来也是OK的。

回复内容:

<code>$cl = new SphinxClient();
$cl->Query("'关键词'",'test1');
</code>

我在使用sphinx,发现很好用,但是关键词为空的时候,他就无法搜索出来数据了。

例如Mysql like %关键词% 查询,为空的时候就获取所有的了。

当关键词为空的时候,到底还能使用sphinx吗,或者直接拉取完所有ID出来也是OK的。

为空还有必要用sphinx吗?直接调用数据库即可。

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