Boosting is a Solr feature that allows for query time reordering of search results. A developer can change the rank of results by specifying additional terms that should be ranked higher than default. For example, to find items that contain either Epi or Cloud, you would normally search for Epi OR Cloud. With boosting, you can influence the order of the returned results. Let's say you want results for both terms but want documents with Cloud to appear above documents that do not contain the term. In this case, use boosting to rank results with that term above others. More details can be found on the Episerver Support Portal.
This feature was added to Ektron CMS 9.10 Service Pack 3. If you are updating from any of the 9.10 versions, you will not need to update / upgrade your Ektron Solr instance.
9.1 SP3+
// This example uses an Expression to return documents that have the word "ektron" // in the description, but order them so that documents that also have the word // "showontop" will appear higher. Ektron.Cms.Framework.Search.SearchManager searchManager = new Ektron.Cms.Framework.Search.SearchManager(ApiAccessMode.Admin); var criteria = new KeywordSearchCriteria(); criteria.ExpressionTree = SearchContentProperty.Description.Contains("ektron") | ( SearchContentProperty.Description.Contains("ektron") & SearchContentProperty.Description.Contains("showontop") ) ^ 5; var results = searchManager.Search(criteria); // This example does the same thing as the previous example, but using a textual // query rather than an expression. criteria = new KeywordSearchCriteria(); criteria.QueryText = "ektron OR (ektron AND showontop) ^ 5"; results = searchManager.Search(criteria);
Below is some sample code on how to achieve boosting with Solr Search when using 9.1 SP2 Ektron.
*Please note that this is a sample and is something that should be reviewed and may need to be tweaked to function in your environment. The support team will not be able to assist with support, customizations, or installations of this sample.
Before 9.1 SP3
Code Download
Please sign in to leave a comment.