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.

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 to an organization:

  1. Parse the query.

  2. Route the query to a specific query pipeline (see Query Pipeline Routing Mechanisms and Rules).

  3. Apply Query parameters rules (see Manage Query Parameter Rules).

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

  5. Apply Stop words rules (see Manage Stop Word Rules).

  6. Apply Filters rules (see Manage Filter Rules).

  7. Apply Query ranking expressions rules (see Manage ranking expression rules).

  8. Apply Featured results rules (see Manage Query Pipeline Featured results).

  9. Apply Ranking weight rules (see Manage Ranking Weight Rules).

  10. Leverage Coveo ML Content Recommendations and Coveo ML Product Recommendations models (see Manage models).

  11. Leverage Coveo ML Automatic Relevance Tuning (ART) models (see About Automatic Relevance Tuning).

  12. Leverage Coveo ML Dynamic Navigation Experience (DNE) models (see Dynamic Navigation Experience).

  13. Send the query to the index.

  14. Apply Triggers rules (see Manage Trigger Rules).

  1. A customer sends the following query from a Coveo-powered search interface integrated within your bookstore commerce site.

    QPOrderOfExecutionExample

    The query is now Harry Potter novel.

  2. The query is routed to the Bookstore Search query pipeline in your Coveo organization.

  3. Apply Query Parameters rules.

    The pipeline contains the two following Query parameters 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.

    QueryParametersExample

    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.

  4. Apply Thesaurus rules.

    The pipeline contains the two following Thesaurus rules:

    1. Replace Harry in the current query with Harry OR wizard OR Hogwarts OR Gryffindor if the advanced query is @source==Books.

    2. Replace the keyword Gryffindor in the current query with Slytherin.

    ThesaurusExample

    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.

  5. Apply Stop words rules.

    The pipeline contains the following Stop words rule:

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

    StopWordExample

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

    FiltersExample

    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. 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 is Harry Potter if the advanced query contains @author=="J. K. Rowling".

    RankingExpressionsExample

    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.

  8. Apply Featured results rules.

    The pipeline contains the following Featured results rule:

    Give a substantial ranking score boost to the item whose title is Harry Potter and the Philosopher's Stone if the advanced query contains @author=="J. K. Rowling".

    FeaturedResultsExample

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

  9. 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 the summary ranking factor if the query contains Gryffindor.

    RankingWeightExample

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

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

  11. Leverage Coveo ML ART models.

    No ART model is configured in the pipeline.

  12. Leverage Coveo ML Dynamic Navigation Experience (DNE) models.

    No Dynamic Navigation Experience (DNE) Coveo ML model is configured.

  13. Send the processed query to the index.

  14. 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 contains Hogwarts.

    TriggersExample

    As the query contains Hogwarts, the rule applies.