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. 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:
{
"query": {
"<query_type>": {
"value": [<query_string>]
}
}
}
Keys
The following table describes the keys that the query
object contains.
Key |
Type |
Description |
Value |
---|---|---|---|
|
Optional. Type of data that you can use to search. Keyphrase data is a general text search. |
|
Query type object
The following table describes the key in the querytype
object:
Key |
Type |
Description |
---|---|---|
|
array |
Required. Contains a string or a list of strings with the |
Related Keys
The following table describes the key related to the query
request.
Key |
Type |
Description |
---|---|---|
|
Boolean |
Use If Default: |
Example
The following are examples of query objects using the keyphrase
red in full and short representations.
Full representation request:
{
"query": {
"keyphrase": {
"value": ["red"]
}
},
"exact_match": true
}
Short representation request:
{
"query": {
"keyphrase": "red"
},
"exact_match": true
}