Search code examples
searchsphinxfull-text-search

How to check if sphinx matched all the words?


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.


Solution

  • 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