I am trying to implement "did you mean" feature using the elasticsearch phrase suggester.
It works OK, except when using field search in query syntax.
The query syntax I use is Query String Query
Here is an example of a query:
{
"from" : 0,
"size" : 10,
"query" : {
"query_string" : {
"query" : "defect.fields.description:(tetsing)",
"use_dis_max" : true
}
},
"suggest" : {
"phrase-suggest-iris" : {
"text" : "defect.fields.description:(tetsing)",
"phrase" : {
"analyzer" : "default",
"field" : "_all",
"max_errors" : 2.0,
"highlight" : {
"pre_tag" : "<b>",
"post_tag" : "</b>"
}
}
}
}
}
And here is what I get in the suggestions:
defect.fields.description testing
The ":" is missing from the suggestions and other operators like "()".
It seems like the suggeter does not keep query syntax.
Any help/suggestion would be appreciated.
Thanks!