I have created a mapping of index searchable:
PUT searchable
{
"mappings": {
"searchCol" : {
"properties" : {
"suggest" : {
"type" : "completion"
},
"title" : {
"type": "keyword"
}
}
}
}
}
with some documents title wise:
PUT music/song/2?refresh
{
"suggest" : [ "val", "value", "val of", "value of" ],
"title" : "a"
}
I want to search suggestion only in particular titled documents such that in title:a documents. But match is not working with suggest.
POST music/_search?pretty&size=1
{
"query" : {"match":{"title": "a"}},
"suggest": {
"suggestion" : {
"prefix" : "val",
"completion" : {
"field" : "suggest"
}
}
}
}
Still searching in all documents. Is there any way to do it?