2013-02-14 97 views
0

我有以下和其他几个字符串索引。所有的单词都粘在一起。SphinxQL - 如何匹配单个字符串内的单词

Stringisaflexiblepieceofropeortwinewhichistt​​ie,bind,orhangotherobjects。

这是一段来自维基百科的句子。

字符串是用于绑定,绑定或挂起其他物体的灵活的绳索或麻线。

我使用SphinxQL来搜索几个单词。例如。

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

这应该返回上述字符串作为结果,但它返回0行。

查询应该怎样看起来不是查找单词,而是简单地匹配字符串中的单词?

我打已经与排名器选项,如

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

,但没有成功。

任何帮助非常感谢!

回答

0

使用min_infix_len - 使缀搜索http://sphinxsearch.com/docs/current.html#conf-min-infix-len

你可能想enable_star = 0

或者,也许你可以用分词索引:) http://sphinxsearch.com/blog/2013/01/29/a-new-tool-in-the-trunk-wordbreaker/

+0

谢谢您的回答之前,重新断开的长字符串。 wordbreakbreak工具很有趣,但尚未提供。我现在将尝试min_infix_len选项。设置enable_star = 0将禁用*选项,但这应该如何帮助? – Aley 2013-02-14 16:31:48

+1

Wordbreaker可用,我自己使用它。你只需从svn获取它https://code.google.com/p/sphinxsearch/source/checkout – barryhunter 2013-02-14 16:39:55

+0

谢谢!有一件事。我为什么要'enable_star = 0'? – Aley 2013-02-14 17:01:27

相关问题