I have an ElasticSearch database that has "pages" in it.
class Page
field :domain_id
field :page_id
field :title
field :description
field :filetype
field :content
end
Each page has an ID of a domain. I'd like to be able to boost the results from a particular domain on all queries. So, if it matches a domain_id of X, set statically, it will be more relevant in every search result we return.
Second, I'd like to boost based on the text (which can be multiple words) matching the title or description with higher relevance, than matching the content for example.
I currently have the following query in the Tire gem.
query { text :_all, search_term }
What should I add to do the 2 things above? If the user enters "title:policy manuals" (without quotes obviously), how will that affect things?