Order of Execution of Query Pipeline Features
Order of Execution of Query Pipeline Features
When a query is sent to your Coveo organization, the query goes through a specific query pipeline before reaching the index. Within any given query pipeline, the various query pipeline features follow a specific order of execution which can’t be altered.
Query pipeline features of the same type are executed in the order in which they appear on the rule’s configuration page. See Change the Rule Order to learn how to change the execution order of rules of the same type.
The following diagram shows the process of a query being sent to a given Coveo organization and the order of execution of query pipeline features.
When a query is sent to an organization:
-
Route the query to a specific query pipeline (see Query Pipeline Routing Mechanisms and Rules).
-
Apply Query parameters rules (see Manage Query Parameter Rules).
-
Apply Thesaurus rules (see Manage Thesaurus Rules).
In some cases, the order in which thesaurus keywords are defined within a thesaurus rule may have an impact on the rule’s behavior. See Using the
alias
Sub-Feature for details. -
Apply Stop words rules (see Manage Stop Word Rules).
-
Apply Filters rules (see Manage Filter Rules).
-
Apply Query ranking expressions rules (see Manage ranking expression rules).
-
Apply Featured results rules (see Manage Query Pipeline Featured results).
-
Apply Ranking weight rules (see Manage Ranking Weight Rules).
-
Leverage Coveo ML Content Recommendations and Coveo ML Product Recommendations models (see Manage models).
-
Leverage Coveo ML Automatic Relevance Tuning (ART) models (see About Automatic Relevance Tuning).
-
Leverage Coveo ML Dynamic Navigation Experience (DNE) models (see Dynamic Navigation Experience).
-
Apply Triggers rules (see Manage Trigger Rules).
-
A customer sends the following query from a Coveo-powered search interface integrated within your bookstore commerce site.
The query is now
Harry Potter novel
. -
The query is routed to the Bookstore Search query pipeline in your Coveo organization.
-
Apply Query Parameters rules.
The pipeline contains the two following Query parameters rules:
-
Override the aq query parameter to
@source==Books
if the query containsnovel
. -
Override the
sortCriteria
query parameter value toDateAscending
if the advanced query is@source==Books
.
As the query currently contains
novel
, rule 3.a. applies.Although rule 3.a. sets the
aq
query parameter to@source==Books
, the advanced query has not yet been updated accordingly. Therefore, rule 3.b. doesn’t apply.After both Query parameters rules have been evaluated:
-
The query is still
Harry Potter novel
. -
The advanced query is now
@source==Books
.
-
-
Apply Thesaurus rules.
The pipeline contains the two following Thesaurus rules:
-
Replace
Harry
in the current query withHarry OR wizard OR Hogwarts OR Gryffindor
if the advanced query is@source==Books
. -
Replace the keyword
Gryffindor
in the current query withSlytherin
.
As the advanced query is now
@source==Books
, rule 4.a. applies.Rule 4.b. has no condition. However, although rule 4.a. adds
Gryffindor
to the query, it has not yet been updated accordingly. Therefore, while the rule applies, it has no effect.-
The query is now
(Harry OR wizard OR Hogwarts OR Gryffindor) Potter novel
. -
The advanced query is still
@source==Books
.
-
-
Apply Stop words rules.
The pipeline contains the following Stop words rule:
Remove
Gryffindor
from the current query if the query containswizard
.As the query now contains
wizard
, the rule applies.-
The query is now
(Harry OR wizard OR Hogwarts) Potter novel
. -
The advanced query is still
@source==Books
.
-
-
Apply Filters rules.
The pipeline contains the following Filters rule:
Add
@author=="J. K. Rowling"
to the aq if the advanced query is@source==Books
.As the advanced query is
@source==Books
, the rule applies.-
The query is still
(Harry OR wizard OR Hogwarts) Potter novel
. -
The advanced query is now
@source==Books @author=="J. K. Rowling"
.
-
-
Apply Query ranking expressions rules.
The pipeline contains the following Query ranking expressions rule:
Apply a
+500
ranking score boost to items whose@bookseries
field value isHarry Potter
if the advanced query contains@author=="J. K. Rowling"
.As the advanced query contains
@author=="J. K. Rowling"
, the rule applies.The query and the advanced query remain unchanged, but the query now includes a query ranking expression.
-
Apply Featured results rules.
The pipeline contains the following Featured results rule:
Give a substantial ranking score boost to the item whose
title
isHarry Potter and the Philosopher's Stone
if the advanced query contains@author=="J. K. Rowling"
.As the advanced query now contains
@author=="J. K. Rowling"
, the rule applies.The query and the advanced query remain unchanged, but the query now includes an additional query ranking expression (QRE).
-
Apply Ranking weights rules.
The pipeline contains the following Ranking weights rule:
Increase the weight of the
title
ranking factor, and lower the weight of thesummary
ranking factor if the query containsGryffindor
.As the query no longer contains
Gryffindor
(it was removed by a Stop words rule in step 5), the rule doesn’t apply. -
Leverage Coveo ML Content Recommendations (CR) and Coveo ML product recommendations models.
No Content Recommendations (CR) and Coveo ML product recommendations model is configured in the pipeline.
-
Leverage Coveo ML ART models.
No ART model is configured in the pipeline.
-
Leverage Coveo ML Dynamic Navigation Experience (DNE) models.
No Dynamic Navigation Experience (DNE) Coveo ML model is configured.
-
Send the processed query to the index.
-
Apply Triggers rules.
The pipeline contains the following Triggers rule:
Send a notification to the end user saying
You're a wizard, Harry!
if the query containsHogwarts
.As the query contains
Hogwarts
, the rule applies.