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

You can add a `suggestion` JSON object in a Sitecore Discover Search and Recommendation request. The `suggestion` object contains the different types of suggestions you can use to autocomplete your query and display predictive search results. Each `<suggestion_type>` provides a specific algorithm to generate suggestions.

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

```csharp
{
  "suggestion": {
    "<suggestion_type>": {
       	"max": 5,
	"in_content": {
         	"value": [{
              	    "type": "<content_type>"
		}]
	}
    }
  }
}
```

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

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

| Key | Type/default value | Description | Value |
| --- | --- | --- | --- |
| suggestion_type> | Suggestion type object | Required.Contains the specific algorithm for generating suggestions. | autocomplete (Default)keyphrasecategorytrending_categoryrecent |

### Suggestion type object

The following table describes the keys in the `suggestion type` object:

| Key | Type | Description |
| --- | --- | --- |
| max | integer | Optional.The maximum number of suggestions.Default: 5. |
| in_content | array | Optional.Contains the specific <content_type> for the requested suggestion.NoteThere is no default value for in_content because there is no limitation on the <content_type> . |

### Suggestion types

The following are different types or algorithms for generating the suggestion:

| Suggestion type | Description | Value |
| --- | --- | --- |
| keyphrase | A mix of suggestions. | type_correctionquery_expansionrelated_search |
| category | Categories that contain the search term. | n/a |
| trending_category | A category that is trending now. | n/a |
| recent | Recent search history. | n/a |

</details>

<details>
<summary><h2>Related key</h2></summary>

The following table describes the key related to the `suggestion` object.

| Key | Type | Description |
| --- | --- | --- |
| `request_for` | array | Optional.<br><br>Contains the request parameters. You can request any field in the [request data](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/search-and-recommendation-data-model/request-structure-and-objects.html "Request structure and objects") or request all fields using the wild card `all`. |

</details>

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

The following shows an example of a request to get the user's last ten search queries in the `product` content type:

```csharp
{
   "suggestion": {
      "recent": {
	"max": 10,
	"in_content": {
	     "value": [{
		"type": "product"
		}]
         }
       }
    }
}
```

</details>