Question

I have the following and several other strings indexed. All words are glued together.

Stringisaflexiblepieceofropeortwinewhichisusedtotie,bind,orhangotherobjects.

Which is a sentence from wikipedia.

String is a flexible piece of rope or twine which is used to tie, bind, or hang other objects.

I use SphinxQL to search for several words. E.g.

SELECT * FROM sentences WHERE MATCH('piece rope bind');

This should return the above string as a result, but it returns 0 rows.

How should the query look like to not look for words, but to simply match the words in a string?

I have played already with the ranker options like

SELECT * FROM sentences WHERE MATCH('piece rope bind') OPTION ranker=matchany';

but with no success.

Any help is much appreciated!

Was it helpful?

Solution

Use min_infix_len - to enable infix searching http://sphinxsearch.com/docs/current.html#conf-min-infix-len

You probably want enable_star = 0

Or maybe you could use WordBreaker to rebreak the long string before indexing :) http://sphinxsearch.com/blog/2013/01/29/a-new-tool-in-the-trunk-wordbreaker/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top