Gravatar for pedro.graca@dogdigital.com

Question by Pedro Graca, Dec 7, 2016 11:16 AM

Is there a way of increasing the weight of a search result based on where a term is found?

Hi,

I wonder if it's possible either using qre or other technique to artificially boost search results where a term is found on a particular field?

This is coveo for sitecore.

Thank you, Pedro

1 Reply
Gravatar for sbelzile@coveo.com

Answer by Sébastien Belzile, Dec 7, 2016 11:44 AM

Yes, simply create a QRE with expression: @myfield=="value_that_you_want".

If you want to use what the user typed, hook yourself on the doneBuildingQuery event to compute your expression.

This question has been asked before and QREs are well documented. If you use the search functionalities on this website, you might find other tips code samples:

  1. https://answers.coveo.com/questions/4258/invoke-qre-only-when-certain-terms-are-searched
  2. https://answers.coveo.com/questions/6804/extracting-the-searchterm-typed-in-by-the-user
  3. https://answers.coveo.com/questions/6754/coveo-for-sitecore-omnibox-result-list-only-search-in-one-specific-field
  4. https://answers.coveo.com/questions/7741/example-of-query-customization-in-coveo-for-sitecore
Ask a question