开发者

How to check if sphinx matched all the words?

开发者 https://www.devze.com 2023-04-01 09:55 出处:网络
In Sphinx QL, I have queries of form : SELECT id FROM index WHERE MATCH(\'word1|word2|word3\') OPTION ranker=matchany, max_matches=100;

In Sphinx QL, I have queries of form :

SELECT id FROM index WHERE MATCH('word1|word2|word3') OPTION ranker=matchany, max_matches=100;

Is there a native way to check if all the words where successfully matched with at least one document? Note that it might not have to be a single document. For instance, word1 can match document1 , word2 can match document2 and word3 can match document3. The result is a success here. Assume there was no match for 开发者_如何转开发word3, the result is a failure then.


Try running SHOW META right after the query - Will give you per keyword hit count

http://sphinxsearch.com/docs/2.0.1/sphinxql-show-meta.html


To make sure that all words got matched at same document you have to issue 2nd query SELECT id FROM index WHERE MATCH('word1 word2 word3');

0

精彩评论

暂无评论...
验证码 换一张
取 消