Solr Sunspot minimum_match

我是新手使用Solr Sunspot for Rails。 我正在尝试使用

 

所以很自然并非所有的代币都能匹配。 我无法弄清楚如何在我的搜索http://outoftime.github.com/sunspot/docs/index.html中使用minimum_matchfunction。 任何帮助将不胜感激。

我试过,我得到0结果:

 Articles.search do fulltext params[:q] do :minimum_match => 1 end end 

你快到了。 哈希语法是指您将最小匹配作为参数传递给fulltext

 Article.search do fulltext params[:q], :minimum_match => 1 end 

在块中,您需要方法调用。

 Article.search do fulltext params[:q] do minimum_match 1 end end