I am using app search for query suggestions. I want to search the query term from 4 fields as shown in the query below. But in the output the suggested term gets divided into three different suggestions based on the white space.
Eg - productcategory field has only one term as "bread and bakery" in the documents but in the output it gives three results as given in the output below.
How can I get only one complete suggestion, i.e. - "bread and bakery"?
My query is -
{
"query": "Bre",
"types": {
"documents": {
"fields": [
"productcategory",
"productsubcategory",
"producttype",
"productnamesearch"
]
}
},
"size": 20
}
The output is -
"results": {
"documents": [
{
"suggestion": "bread"
},
{
"suggestion": "bread and"
},
{
"suggestion": "bread and bakery"
}
]
}