I have a document with two fields; "title" and "description".
When performing query, I want to give a significant preference to documents having search term in their "title", e.g. show all documents with term in "title" and only after then show documents with term in "description". In other words, documents with term in "title" shall score much much higher than documents with term in "description".
I using SimpleQueryString since I allow to provide expressions as search terms.
I was trying to provide different boost values to "title" and "description" fields (e.g. 100 vs 1) and I was trying to use DisMax with these Boost values for each of the queries - it doesn't seems to work. It looks like boost values simply ignored.
Is there any way to achieve what I looking for with SimpleQueryString?
return query ; } I don't see that received search results favor in some way "Title". Instead, many of first results (e.g. results with highest score) are based on "Description" field. I see that results with "KuKu" in "Description" appear before results with "KuKu" in "Title".
I would expect that **all** results with "KuKu" in "Title" will appear before any of results with "KuKu" in "Description", since I gave "Title" much higher Boost value.
you can set `type` on SimpleQueryString as well. it should have the same effect. Another way is to use `copy_to` in your mapping and copy both fields in an uber field and search just in that one field for scoring. That is common practice.