sphinx分域搜索

http://stackoverflow.com/questions/2526407/complex-query-with-sphinx

比如要实现和如下sql代码相同的功能:

SELECT * FROM table
   WHERE yescolumn = 'query' 
   AND othercolumn not like '%keyword%'

You can use Sphinx's extended query syntax to pick the fields you want to search. Try running a query through Sphinx like this:

@yescolumn query @othercolumn -keyword

So in a PHP page you might have a link to a Sphinx database named $sphinx:

$sphinx->SetMatchMode(SPH_MATCH_EXTENDED2);
$results = $sphinx->Query('@yescolumn query @othercolumn -keyword');

更多信息看sphinx的文档关于searching的部分。

posted @ 2014-02-27 13:02  zmiao  阅读(116)  评论(0编辑  收藏  举报