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, unchangeable order of execution.
Note
Query pipeline features of the same type are executed in the order 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 from a Coveo-powered search interface, which is configured to route queries to a specific query pipeline. the query goes through the following steps:
Note
Before the query enters the query pipeline flow, Coveo ML Query Suggestions (QS) or Predictive Query Suggestions (PQS) are displayed to the user as they type their query. |
-
Query parameter rules are applied.
-
Thesaurus rules are applied.
NoteSometimes, 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. -
Stop word rules are applied.
-
Filter rules are applied.
-
Ranking expression rules are applied.
-
Featured results rules are applied.
-
Ranking weight rules are applied.
-
Coveo ML Content Recommendations (CR) and Product Recommendations (PR) models are queried.
-
Coveo ML Automatic Relevance Tuning (ART) models are applied.
-
Coveo ML Intent-Aware Product Ranking (IAPR) models are applied.
-
Coveo ML Dynamic Navigation Experience (DNE) item boosting is applied.
-
Trigger rules are applied.
-
The query is sent to the index in which the query is processed and Coveo ML Semantic Encoder (SE) models are applied.
-
Coveo ML Dynamic Navigation Experience (DNE) models facet ordering is applied.
-
Coveo ML Smart Snippets models are applied.
-
Coveo ML Relevance Generative Answering (RGA) models are applied.
Example
A visitor accesses the Coveo-powered search interface of your bookstore ecommerce website. This search interface is configured to route queries to the Bookstore Search query pipeline.
-
A visitor starts typing the following query:
Harry P
. -
The Coveo ML QS (or PQS) model suggests the following query:
Harry Potter novel
, which the visitor selects.The query is now
Harry Potter novel
. -
The query pipeline contains the two following Query parameter 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
.Since the query currently contains
novel
, the rule to override theaq
query parameter to@source==Books
applies. Although rule 3.a. sets theaq
query parameter to@source==Books
, the advanced query hasn’t yet been updated accordingly. Therefore, rule 3.b. doesn’t apply.After both Query parameter rules have been evaluated:
-
The query is still
Harry Potter novel
. -
The advanced query is now
@source==Books
.
-
-
-
The pipeline contains the two following Thesaurus rule:
Replace
Harry
in the current query withHarry OR wizard OR Hogwarts OR Gryffindor
if the advanced query is@source==Books
.As the advanced query is now
@source==Books
, the rule applies.-
The query is now
(Harry OR wizard OR Hogwarts OR Gryffindor) Potter novel
. -
The advanced query is still
@source==Books
.
-
-
The pipeline contains the following Stop word 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
.
-
-
The pipeline contains the following Filters rule:
Add
@author=="J.K. Rowling"
to theaq
if the advanced query is@source==Books
.Since the advanced query is
@source==Books
, the rule to add@source==Books
to theaq
applies.-
The query is still
(Harry OR wizard OR Hogwarts) Potter novel
. -
The advanced query is now
@source==Books @author=="J.K. Rowling"
.
-
-
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.While the query and the advanced query remain unchanged, the query now includes a query ranking expression (QRE).
-
The pipeline contains the following Featured result rule:
Pin at the top of the search results 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 QRE representing the featured result rule.
-
The pipeline contains the following Ranking weight 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 6), the rule doesn’t apply. -
No Coveo ML Content Recommendation (CR) and Product Recommendation (PR) models are configured in the query pipeline as Coveo ML CR and PR models must be configured in separate query pipelines.
-
The query pipeline contains a Coveo ML ART model. Therefore, the model finds the most clicked items for the
(Harry OR wizard OR Hogwarts) Potter novel
query. -
The query pipeline contains a Coveo ML IAPR model. Therefore, the model embeds the visitor’s user session vector into the product vector space to find the products that are the most relevant to the visitor’s current intent.
-
The query pipeline contains a Coveo ML DNE model. Therefore, the model finds the most clicked facet values for the
(Harry OR wizard OR Hogwarts) Potter novel
query, and then applies QREs to boost the search results whose field values match the values of those popular facets. -
The pipeline contains the following Trigger 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. -
The processed query is sent to the index, which contains a Coveo ML SE model. Therefore, the model uses vector search to retrieve the most relevant items that have a high semantic similarity with the
(Harry OR wizard OR Hogwarts) Potter novel
query.The most relevant search results are then sent to the Coveo ML RGA model for answer generation.
-
Since the query pipeline contains a Coveo ML DNE model, the model finds the most relevant facets for the
(Harry OR wizard OR Hogwarts) Potter novel
query and orders them (and their values) to display the most relevant ones first. -
The query pipeline contains a Coveo ML Smart Snippet model. Therefore, the model extracts the most relevant passages from the most relevant search results for the
(Harry OR wizard OR Hogwarts) Potter novel
query. -
The query pipeline contains a Coveo ML RGA model. Therefore, based on the search results found by the Coveo ML SE model, the model generates the most relevant answers to the
(Harry OR wizard OR Hogwarts) Potter novel
query. -
The search results, smart snippets, and generated answers are shown to the visitor in the Coveo-powered search interface.