I have the Rails project with User model.
It has two fields: :name
, :surname
Also I have sunset search:
searchable do
text :name
text :surname
end
When I do such search:
User.solr_search { fulltext 'Name Surname' } .results
how to get results all results in such order:
- where name and surname are
'Name Surname'
- where only surname is
'Surname'
- where only name is
'Name'
Also I found, but I don't understand is that what I need https://github.com/sunspot/sunspot/wiki/Matching-substrings-in-fulltext-search