0

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!

Aley
  • 8,540
  • 7
  • 43
  • 56

1 Answers1

0

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/

barryhunter
  • 20,886
  • 3
  • 30
  • 43
  • Thanks for your answer. The wordbreak tool is interesting, but is not available yet. I will try the min_infix_len option now. Setting enable_star = 0 will disable the * option, but how should this help? – Aley Feb 14 '13 at 16:31
  • 1
    Wordbreaker is available, I've used it myself. You just grab it from svn https://code.google.com/p/sphinxsearch/source/checkout – barryhunter Feb 14 '13 at 16:39
  • Thanks! One thing though. Why do I want 'enable_star = 0'? – Aley Feb 14 '13 at 17:01
  • 1
    if you set enable_star =1 then you will need to add stars into the query to match part words. – barryhunter Feb 14 '13 at 18:23