How to boost a document if full query text is present in it? – Solr

Home / Uncategorized / How to boost a document if full query text is present in it? – Solr

Question:
I need to give priority to the documents where full search term occurs. For example if the search term is "Georgia Tech", I want the document having "Georgia Tech" in it to have extra boost than those having more frequent "Georgia" term in them.


Answer:
that is almost standard:index it two fields (use copyField), one whitespace (or similar) tokenized, one as a keyword.
you use edismax and boost the keyword field with more weight than the other
Read more

Leave a Reply

Your email address will not be published. Required fields are marked *