I have trouble with searching with the sunspot gem. I want to search for user email in an object tenant.
tenant has many users
In the tenant I did this:
searchable do
text :name, :notifications_email
text :users do
users.map(&:email)
end
end
Searching for the name
and notifications_email
works fine, but when I search for an email of the user no result is found.
I did this in the console:
s = Tenant.solr_search do fulltext "info" end
I get this object:
<Sunspot::Search:{:fq=>["type:Tenant"], :q=>"info", :fl=>"* score", :qf=>"name_text notifications_email_text users_text", :defType=>"dismax", :start=>0, :rows=>30}>
What confuses me is that there is users_text
doesn't it have to be users_email_text
or something like this?