Order of execution of query pipeline features

In this article

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.

Note

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.

diagram showing order of execution

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.

  1. Query parameter rules are applied.

  2. Thesaurus rules are applied.

    Note

    Sometimes, 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.

  3. Stop word rules are applied.

  4. Filter rules are applied.

  5. Ranking expression rules are applied.

  6. Featured results rules are applied.

  7. Ranking weight rules are applied.

  8. Coveo ML Content Recommendations (CR) and Product Recommendations (PR) models are queried.

  9. Coveo ML Automatic Relevance Tuning (ART) models are applied.

  10. Coveo ML Intent-Aware Product Ranking (IAPR) models are applied.

  11. Coveo ML Dynamic Navigation Experience (DNE) item boosting is applied.

  12. Trigger rules are applied.

  13. The query is sent to the index in which the query is processed and Coveo ML Semantic Encoder (SE) models are applied.

  14. Coveo ML Dynamic Navigation Experience (DNE) models facet ordering is applied.

  15. Coveo ML Smart Snippets models are applied.

  16. 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.

  1. A visitor starts typing the following query: Harry P.

  2. 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.

  3. The query pipeline contains the two following Query parameter rules:

    1. Override the aq query parameter to @source==Books if the query contains novel.

    2. Override the sortCriteria query parameter value to DateAscending if the advanced query is @source==Books.

      As the query currently contains novel, rule 4.a. applies. Although rule 4.a. sets the aq query parameter to @source==Books, the advanced query hasn’t yet been updated accordingly. Therefore, rule 4.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.

  4. The pipeline contains the two following Thesaurus rule:

    Replace Harry in the current query with Harry 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.

  5. The pipeline contains the following Stop word rule:

    Remove Gryffindor from the current query if the query contains wizard.

    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.

  6. 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".

  7. The pipeline contains the following Query ranking expressions rule:

    Apply a +500 ranking score boost to items whose @bookseries field value is Harry 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 (QRE).

  8. The pipeline contains the following Featured result rule:

    Pin at the top of the search results the item whose title is Harry 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.

  9. The pipeline contains the following Ranking weight rule:

    Increase the weight of the title ranking factor, and lower the weight of the summary ranking factor if the query contains Gryffindor.

    As the query no longer contains Gryffindor (it was removed by a Stop words rule in step 6), the rule doesn’t apply.

  10. 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.

  11. 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.

  12. 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.

  13. 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.

  14. The pipeline contains the following Trigger rule:

    Send a notification to the end user saying You’re a wizard, Harry! if the query contains Hogwarts.

    As the query contains Hogwarts, the rule applies.

  15. 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.

  16. 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.

  17. 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.

  18. 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.

  19. The search results, smart snippets, and generated answers are shown to the visitor in the Coveo-powered search interface.