Forming query with unreserved characters

I am trying to query a keyword that has a dot (.) appended to it. The query works fine on Kibana's console but not on my application's function. This is the function that creates the query given a keyword:

    searchOperation(keyWord:String){
    
    {
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "fields": ["message"],
            "query": keyWord + " AND \"DateID\""
          }
        }]
    }}}}

An example keyword that contains that character is: "BAD.IJH.KLM"

I append an escape character ('\') before and after the quotation marks so it becomes \"BAD.IJH.KLM\" and my query would look like this :

    

    {
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "fields": ["message"],
            "query": "\"BAD.IJH.KLM\" AND \"DateID\""
          }
        }]
    }}}

but my query doesn't search for the exact keyword with the dots and instead searches for subtrings within "BAD.IJH.KLM". How can I modify my keyword/query so the query searches for the exact string with characters that are not part of the reserved characters?

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