---
title: "The query request object"
slug: "the-query-request-object"
abstract: "Describes the structure and properties of the query object in a Sitecore Discover Search and Recommendation request."
---
# The query request object

You can add a `query` JSON object in a Sitecore Discover Search and Recommendation request. The object contains the query string for each type of query. The value of each `<query_type>` is a [value object](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/search-and-recommendation-data-model/request-structure-and-objects/annotations-and-terms.html#UUID-2e6e272c-5601-6ab0-e594-5fd25aa93318_section-idm4542587877929632876121293693 "Type of value object"). The value of the value object is a list containing either a string or a list of strings.

If a query does not return any results, Sitecore Discover runs another query using the top suggestion from the original query.

The following shows the basic structure of the `query` object in a request:

```csharp
{
    "query": {
	"<query_type>": {
           "value": [<query_string>]
	}
    }
}
```

<details>
<summary><h2>Keys</h2></summary>

The following table describes the keys that the `query` object contains.

| Key | Type | Description | Value |
| --- | --- | --- | --- |
| <query_type> | Query type object | Optional.Type of data that you can use to search. Keyphrase data is a general text search. | keyphrase |

### Query type object

The following table describes the key in the `querytype` object:

| Key | Type | Description |
| --- | --- | --- |
| `<query_type>.value` | array | Required.<br><br>Contains a string or a list of strings with the `<query_string>` values. |

</details>

<details>
<summary><h2>Related Keys</h2></summary>

The following table describes the key related to the `query` request.

| Key | Type | Description |
| --- | --- | --- |
| `exact_match` | Boolean | Use `exact_match` to control the search behavior by matching the query `keyphrase`.<br><br>If `true`, Discover searches only using the exact `keyphrase`.<br><br>Default: `false` |

</details>

<details>
<summary><h2>Example</h2></summary>

The following are examples of query objects using the `keyphrase` *red* in [full and short representations](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/search-and-recommendation-data-model/request-structure-and-objects/annotations-and-terms.html#UUID-2e6e272c-5601-6ab0-e594-5fd25aa93318_section-idm4542587877929632876121293693 "Type of value object").

Full representation request:

```csharp
{
    "query": {
	"keyphrase": {
		"value": ["red"]
    	 }
    },
     "exact_match": true
}
```

Short representation request:

```csharp
{
    "query": {
	"keyphrase": "red"
    },
    "exact_match": true
}
```

</details>