In the Photo model I have following simple rule:
searchable do
string :note
end
and I try to search some string with Solr (simultaneously in two tables). This is the output of Solr query in the terminal (the first one for Articles, the second one for Photos):
SOLR Request (4.8ms) [ path=# parameters={data: fq=type%3A Article&q=searched_string&fl=%2A+score&qf=title+content&defType=dismax&start=0&rows=30 , method: post, params: {:wt=>:ruby}, query: wt=ruby, headers: {"Content-Type"=>"application/x-www-form-urlencoded; charset=UTF-8"}, path: select, uri: http://localhost:8982/solr/select?wt=ruby, open_timeout: , read_timeout: } ]
and this
SOLR Request (4.4ms) [ path=# parameters={data: fq=type%3A Photo&q=asgasg&fl=%2A+score&defType=dismax&start=0&rows=30 , method: post, params: {:wt=>:ruby}, query: wt=ruby, headers: {"Content-Type"=>"application/x-www-form-urlencoded; charset=UTF-8"}, path: select, uri: http://localhost:8982/solr/select?wt=ruby, open_timeout: , read_timeout: } ]
controller:
@articles = Article.search do
fulltext params[:search]
end
@photos = Photo.search do
fulltext params[:search]
end
## => searching ##
puts @articles.results #work fine
puts @photos.results #always 0
I totally don't know, why SOLR doesn't search in the Photo model... everything should be specified and set up, but still don't know, where is the problem...