Usecase: Typeahead search:
I have a question with Multi_field search, the property with type I have is:
content: {
type: "string"
fields: {
raw: {
type: "string"
index: "not_analyzed"
}
}
}
So as and when I type I must be able to fetch the results, now what is optimal way to search against content and content.raw field?
I was thinking of a query like this?
"bool" : {
"should" : [
"match" : {
"content" : { "query" : "post", "operator" : "and" }
},
"match" : {
"content.raw" : { "query" : "postin", "operator" : "and" }
}
]
}