2010-11-09 168 views
0

我想搜索文字的单词prefiexed $。

记录样本(表3行):

This is my string containing the $word special word. 
Again $word is here. 
My special $word must be found. 

例回报率(思维狮身人面像):

MyModel.search '$word' 

我没有得到任何结果,但如果我搜索 '\ $字' 字被发现。

我该如何解决这个问题?

回答

3

狮身人面像用作单词分隔符除英文字母以外的任何字符。这意味着'$'从未编入索引并等同于一个空格。没办法,你可以找到它。

http://sphinxsearch.com/docs/current.html#conf-charset-table

在你的config/sphinx.yml添加类似:

charset_table: 0..9, A..Z->a..z, _, a..z, $ 

重建,重新启动并找到它!