Sunsopt Solr全文搜索和群组无效
a = User.search { fulltext("") { highlight :document_text, :fragment_size => 300, :group => document_id }}
--- SOLR Request (9.7ms) [ path=select parameters={fq: ["type:User"], start: 0, rows: 30, q: "*:*"} ]
=> <Sunspot::Search:{:fq=>["type:User"], :start=>0, :rows=>30, :q=>"*:*"}>
2.1.2 :081 > a.group(:document_id)
=> nil
我也是这样尝试
User.search { fulltext("terms", :group => "doc_name") { highlight :document_text, :fragment_size => 300 }}
相同
答案 0 :(得分:0)
你的user.rb
也应该有solar的搜索块。
##for sunspot search..something like this...
searchable do
text :username, :boost => 3
text :first_name,:last_name
end