2010-11-09 169 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, $ 

重建,重新啓動並找到它!