Coveo for Sitecore - Field value based Sorting
I have two Rich text fields in my Sitecore template. I would like to prioritize result based on heading tags in their values. Is it possible out of the box in Coveo Search or Do we need to write custom logic?
Yes, you can use query ranking expressions (or QRE) for boosting.
- Coveo for Sitecore - Free + Pro edition documentation.
- Coveo for Sitecore - Enterprise edition documentation.
- Coveo Search API documentation
Basically, for a given query, you can specify that you wish to boost its results by the value of a `modifier`.
In your case, you should get something like:
Supposing your rich text fields are rendered on the page for those items and you are indexing the rendered HTML version of the items with the `HtmlContentInBodyWithRequestsProcessor`. The Coveo index automatically boosts these documents in the search results if the user searched terms are found in an HTML heading tag. Same if the terms are found in bold, underlined, italic, uppercase in the original HTML document.
You don't have to tweak anything to make it work.