What Are Query Ranking Expressions?
A QRE consists of:
Any valid query expression
One or many terms and one or many operators supported by Coveo Enterprise Search (CES), including date queries, Boolean queries, field queries, etc.
A ranking modifier
A value that either boosts or decreases the ranking score of documents that match the query expression.
Note: The QRE modifier value is correlated to the final search results ranking score by a 1 to 10 ratio.
Example: A QRE is made of the @author=="Barack Obama" query expression and the +10 modifier value. In search results, all documents for which Barack Obama is the author will have 100 added to their normal ranking score. The ranking score of returned documents with other authors is not affected.
You can implement one or more QREs in a given context. There are no hard limits to the number of QREs that can be evaluated, although implementing several may have an impact on search interface performances.
QRE Usage Example
In a search interface that has a large scope, QREs can boost search results matching your relevance criteria, but still return results from the whole scope, as opposed to reducing the scope of the search interface to show only the more relevant content.
Example: The search interface of an Engineering department Intranet site has a scope that includes the Intranet content (source named Intranet_Eng ), but also other Engineering documents repositories. This large scope is useful as engineers can search all Engineering content from one place. However, because they search from the Intranet, they are likely to be looking primarily for content from the Intranet.
If you want to favor search results from the Intranet in this search interface, you can define a QRE with the query expression @source="Intranet_Eng" and a modifier of +50 to boost the ranking of Intranet search results and provide better contextual search results.
QREs should use a modifier between -100 and +100 to alter ranking without completely overriding it. A match for a document and QRE using a modifier of 100 gives approximately the same score bonus as a non-frequent term matching a title.
How to Implement QREs?
An administrator can add QREs to specific search interfaces from the Interface Editor for a search interface (see Customizing the Ranking for a .NET Search Interface) or for a Related Results panel (see Adding or Customizing a Related Results Panel With the .NET Interface Editor).
A developer can implement QREs programmatically (see Adding Query Ranking Expressions to a Search Interfaces).