--- title: Add query ranking expressions at query time slug: '303' canonical_url: https://docs.coveo.com/en/303/ collection: javascript-search-framework source_format: adoc --- # Add query ranking expressions at query time A query ranking expression (QRE) is used to modify the ranking of search results. Search results that match the QRE will see their relevance either increased or decreased, depending on the specified settings. In other words, this allows you to modify the order of appearance of search results. For example, you may want to see search results that contain the word `sales` in their title appear first, no matter what query is executed. Using the JavaScript Search Framework, there are essentially two ways to attach a QRE to your queries. The following sections will demonstrate both of them. > **Notes** > > * Typically, a better approach is to define ranking expression and featured result query pipeline rules rather than enforcing QREs in the search interface (see [Use query ranking expressions](https://docs.coveo.com/en/2777/)). > * A QRE in the JavaScript Search Framework is a form of query extension. > For more information, see [Query extension language basics](https://docs.coveo.com/en/1465/) and [Standard query extensions](https://docs.coveo.com/en/1462/). > * A ranking modifier actually increases or decreases the relevance of search results, depending if its value is positive or negative respectively. > Technically, its value can be in the range –2{caret}31..2{caret}31, but it's generally set to somewhere between –100..100, as this won't completely override the different ranking weights of search results (except for results that have the same QRE weight). > * The QRE `modifier` value is correlated to the item ranking score by a 1 to 10 ratio. > > > [example] > .Example A QRE `modifier` value is `100`. Consequently this QRE adds `1000` to the ranking score of matching items. ##### ==== ## Attaching a QRE using the `init` method . From the host where the JavaScript Search Framework package is deployed, using a text editor: .. Open your search page in a text editor. .. Under the node `