Please help me with below query. When using special characters in include query it's throwing error.
{"query": {"bool": {"filter": [{"wildcard": {"core_skills.keyword": "*c(pro*"}}]}}, "size": 0, "aggs": {"group_by_core_skills": {"terms": {"field": "core_skills.keyword", "include": ".*c(pro.*", "size": 2000}}}}
Above query is throwing error-
{
"error" : {
"root_cause" : [
{
"type" : "x_content_parse_exception",
"reason" : "[1:183] [terms] failed to parse field [include]"
}
],
"type" : "x_content_parse_exception",
"reason" : "[1:183] [terms] failed to parse field [include]",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "expected ')' at position 9"
}
},
"status" : 400
}
CodePudding user response:
Try edit like this:
"include": ".*c\\(pro.*",