--- title: Associate a model via query pipeline statements slug: '1455' canonical_url: https://docs.coveo.com/en/1455/ collection: leverage-machine-learning source_format: adoc --- # Associate a model via query pipeline statements You can configure [Coveo Machine Learning](https://docs.coveo.com/en/188/) [models](https://docs.coveo.com/en/1012/) by creating [query pipeline statements](https://docs.coveo.com/en/236/) expressing the `facetSense`, `querySuggest`, `recommendation`, or `topClicks` features (see [Query pipeline features](https://docs.coveo.com/en/1450#query-pipeline-features)). Coveo ML models can enhance the end-user experience by: * Providing [query](https://docs.coveo.com/en/231/) suggestions that have yielded relevant results in the past (`querySuggest`, or [Query Suggestion (QS)](https://docs.coveo.com/en/1015/) models). * Recommending related content based on the end-user's recent actions, as well as on actions previously performed by similar end users (`recommendation`, or [Content Recommendation (CR)](https://docs.coveo.com/en/1016/) models). * Ensuring that contextually relevant [items](https://docs.coveo.com/en/210/) appear in the query result list with an elevated ranking score, even if those items don't match the basic and/or advanced query expression (`topClicks`, or [Automatic Relevance Tuning (ART)](https://docs.coveo.com/en/1013/) models). * Reordering facets and facet values, and providing category-based item ranking score boosts (`facetSense`, or _dynamic navigation experience_ models). > **Note** > > In the [Coveo Administration Console](https://docs.coveo.com/en/183/), you can manage statements expressing Coveo ML features from the **Machine learning** tab in a query pipeline configuration page. > > See [Manage models](https://docs.coveo.com/en/1832/). > > Dynamic Navigation Experience (`facetSense`, or DNE) models can't currently be managed as query pipeline statements from the Administration Console. > However, you can manage DNE models and model associations from the Administration Console (see [Create a Dynamic Navigation Experience model](https://docs.coveo.com/en/3396/) and [Associate a model with a query pipeline](https://docs.coveo.com/en/2816#associate-a-model-with-a-query-pipeline)). The following diagram shows the process of a query being sent to the Search API and the [order of execution of query pipeline features](https://docs.coveo.com/en/1376/). > **Note** > > Only [query pipeline statements](https://docs.coveo.com/en/236/) expressing the `queryParamOverride` feature may affect a QS request (that is, a `GET` or `POST` request to the `/rest/search/v2/querySuggest` route) before the `querySuggest` feature applies. ## Syntax Use the following [query pipeline language (QPL)](https://docs.coveo.com/en/235/) syntax to define a statement expressing the `topClicks`, `querySuggest`, `recommendation`, or `facetSense` features: ```http topClicks | querySuggest | recommendation | facetSense ``` ### `` A comma-separated list of key-value pairs, where each key-value must be a valid [QPL Coveo ML model configuration option](#qpl-coveo-ml-model-configuration-options). ## QPL Coveo ML model configuration options The following table details the available configuration options when creating a Coveo ML model through QPL. [%header,cols="1,1,1,1,3"] |=== |Option |Type |Applicable models |Default Search API value |Description |`enabled` |Boolean |All |`true` |Whether to enable the model. |`commonFilter` |String |All |`""` |The filter to apply to common event dimensions when exporting Coveo Analytics data to build the model. |`searchEventFilter` |String |All |`""` |The filter to apply to search event dimensions when exporting Coveo Analytics data to build the model. |`customEventFilter` |String |All |`""` |The filter to apply to custom event dimensions when exporting Coveo Analytics data to build the model. |`exportPeriod` |String |All |`"P1W"` |The length of time to consider when exporting Coveo Analytics data to build/rebuild the model. Must be in the [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals) format. |`exportOffset` |String |All |`"P0D"` |The offset period to apply when exporting Coveo Analytics data to build/rebuild the model. Must be in the [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals) format. |`refreshRate` |String |All |`"P1W"` |The frequency at which to rebuild the model. Must be in the [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals) format. |`cacheMaximumAge` |String |All |`"PT1800s"` |The maximum age of cached query results items to consider. Must be in the [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals) format. |`displayName` |String |All |`None` |A descriptive human-readable display name for the model. |`maxResults` |Unsigned integer |All except `facetSense` |See description |The maximum number of recommendations the model can output. Default Search API value is `10` for `querySuggest` and `5` for `topClicks`. For `recommendations`, the `numberOfResults` parameter of the search request is used by default. |`modifier` |Integer |All except `querySuggest` |`50` (`facetSense`) or `1000` (`recommendation`/`topClicks`) |The ranking score modifier to apply to items recommended by the model. Must be in range `[-1000000, 1000000]`. |`matchQuery` |Boolean |`topClicks` only |`false` |Whether items recommended by the model must match the basic query expression. |`matchAdvancedQuery` |Boolean |`topClicks` only |`true` |Whether items recommended by the model must match the advanced query expression. |`useRefinedQuery` |Boolean |`topClicks` only |`false` |Whether to enable the Intelligent Term Detection (ITD) feature on the model. |===