Forming query with extra quotation marks

I am trying to mimic Kibana's search query via Elasticsearch's query string. For e.g. in Kibana I can search like this with the quotation marks:
"ABC" AND "CDE"
When I try to create this query string it throws a syntax error:
{
"query": {
"query_string": {
"fields": ["messages"]
"query": ""ABC" AND "CDE"" (syntax error occurs here)
}
}
}
How can I form this query so that it can accept the quotation marks?

Would need to esacape the doube quotes. Something like

"query": "\"ABC\" AND \"CDE\""

1 Like

This works fine with reserved characters but I have strings with unreserved characters such as a dot (.). For e.g. a string like "BAD.IJH.KLM"
The escape character does not seem to work with such strings. How can I modify my query in this case? Thanks!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.