---
title: Coveo Related Query
slug: '3043'
canonical_url: https://docs.coveo.com/en/3043/
collection: coveo-for-sitecore-v5
source_format: adoc
---
# Coveo Related Query
> **Legacy feature**
>
> The Coveo Hive Framework is now in maintenance mode and is no longer recommended for new implementations.
>
> To build new search experiences, use one of Coveo's more modern, lightweight, and responsive libraries.
> To get started, see the [Build search](https://docs.coveo.com/en/2473/) article.
Implements the [Coveo JavaScript Search Framework](https://docs.coveo.com/en/187/) [Recommendation](https://coveo.github.io/search-ui/components/recommendation.html) component to get a result list related to the one executed in the main search interface.
The main purpose of the **{doctitle}** rendering is to execute a second query, slightly different from the current search interface query, which may take into account, or not, the current search interface filters in its [advanced query expression (`aq`)](https://docs.coveo.com/en/175/) and the current search interface query expression in its [basic query expression (`q`)](https://docs.coveo.com/en/178/).
## Usage notes
* The **{doctitle}** rendering always acts as a full-fledged search interface and requires a dedicated analytics component (see [Coveo for Sitecore Analytics](https://docs.coveo.com/en/2186/)).
* When bound to a search interface through the `Main search interface` data source option, the **{doctitle}** rendering inherits the [**Sitecore Instance Filter** configurations set on that search interface](https://docs.coveo.com/en/3044/?c4scV5HiveType=tab-hive#data-source-options).
When not bound to a search interface, you can add [Sitecore Instance Filter](https://docs.coveo.com/en/2192/) and [Query Filter](https://docs.coveo.com/en/3038/) renderings in the `Recommendations Components` placeholder to apply filtering on your Sitecore instance items.
* {empty}
--
[.version.c4sc.c4sc-new.5-0-822-2.October-30&-2020]
[Coveo for Sitecore 5.0.822.2](https://docs.coveo.com/en/3360#release-notes)
--
The [Sitecore Instance Filter](https://docs.coveo.com/en/2192/) rendering is now added automatically with the **{doctitle}** rendering.
This adds the new [`Filter results based on the current Sitecore context database` data source option](#data-source-options) which lets you control whether to add a filter on the current Sitecore context database in the [constant query expression (`cq`)](https://docs.coveo.com/en/179/).
Prior to the October 30, 2020 release, related query recommendations were automatically filtered on the current Sitecore context database.
* You can [customize the CSS](https://docs.coveo.com/en/2342/) associated with this rendering.
## Insertion location
Coveo Hive
The Coveo Related Query rendering is an Allowed Control in the following placeholder(s): Coveo UI, Recommendations.
Example insertion sequence for the Coveo Related Query rendering.
Coveo Hive SXA
Coveo for Sitecore SXA rendering insertion locations aren't limited by placeholder Allowed Controls. The Coveo Related Query rendering may therefore be inserted throughout the partial design, whether in Coveo for Sitecore or Sitecore placeholders.
Example insertion sequence for the Coveo Related Query rendering.
## Data source options
The following table lists the available data source options for this rendering.
[%header,cols="33%,66%"]
|===
|Option name
|Description
|Main search interface
|See the [mainSearchInterface](https://coveo.github.io/search-ui/components/recommendation.html#options.mainsearchinterface) component option.
|Use the search interface current filters
|Adds `advancedExpression` to the [optionsToUse](https://coveo.github.io/search-ui/components/recommendation.html#options.optionstouse) component option values.
|Use the search interface current query
|Adds `expression` to the [optionsToUse](https://coveo.github.io/search-ui/components/recommendation.html#options.optionstouse) component option values.
|Title
|The text to show in the header.
|Hide if no results
|See the [hideIfNoResults](https://coveo.github.io/search-ui/components/recommendation.html#options.hideifnoresults) component option.
a|{empty}
--
[.version.c4sc.c4sc-new.5-0-822-2.October-30&-2020]
[Coveo for Sitecore 5.0.822.2](https://docs.coveo.com/en/3360#release-notes)
--
Filter results based on the current Sitecore context database
|See the [Sitecore Instance Filter](https://docs.coveo.com/en/2192/?c4scV5HiveType=tab-hive#data-source-options) rendering data source options.
|Filter results on the current context language
|See the [Sitecore Instance Filter](https://docs.coveo.com/en/2192/?c4scV5HiveType=tab-hive#data-source-options) rendering data source options.
|Filter results on the latest version
|See the [Sitecore Instance Filter](https://docs.coveo.com/en/2192/?c4scV5HiveType=tab-hive#data-source-options) rendering data source options.
|Results per page
|See the [resultsPerPage](https://coveo.github.io/search-ui/components/searchinterface.html#options.resultsperpage) component option.
|Excerpt length
|See the [excerptLength](https://coveo.github.io/search-ui/components/searchinterface.html#options.excerptlength) component option.
|Automatically trigger first query
|See the [autoTriggerQuery](https://coveo.github.io/search-ui/components/searchinterface.html#options.autotriggerquery) component option.
|Hide until first query
|See the [hideUntilFirstQuery](https://coveo.github.io/search-ui/components/searchinterface.html#options.hideuntilfirstquery) component option.
|Enable history
|See the [`enableHistory`](https://coveo.github.io/search-ui/components/searchinterface.html#options.enablehistory) component option.
|Custom CSS classes
|See [Insert Custom CSS](https://docs.coveo.com/en/2342/).
|Initialization file name
|See [Custom Initialization Scripts](https://docs.coveo.com/en/2788/).
|DOM unique ID
a|{empty}
--
Randomly generated HTML element ID.
--
|Additional data attributes
a|{empty}
--
Allows [use of the Coveo JavaScript Search Framework **Recommendation** component options](https://docs.coveo.com/en/2776/) that aren't directly available in the data source.
--
|===
## Sample generated HTML and corresponding visual output
In the example below, the `Use the search interface current query` data source option is selected, and the `Use the search interface current filters` option isn't selected.
```html
```
