Imagine a situation when your client tells you that he/she wants to promote some of his/her products by placing them at the top of the search result list. Additionally, the client would like the product list to be flexible, that is, he/she would like to be able to define the list for some queries and not for others. Many thoughts come into your mind such as boosting, index time boosting, or maybe some special field to achieve that. But don't bother, Solr can help you with a component that is known as solr.QueryElevationComponent
.
The following recipe will help you to place document over others based on your priorities:
First of all let's modify the
solrconfig.xml
document. We need to add the component definition. To do that add the following section to yoursolrconfig.xml
file:<searchComponent name="elevator" class="solr.QueryElevationComponent" > <str name="queryFieldType">string</str> <str name="config...