2

I am trying to a elastic search query on string data type ,but still getting blank response

My query string is like :

GET  orders/_search
{
              "from" : 0,
        "size" : 10000,
      "query":
    { "bool": {"must": [
                     {
          "terms": {
              "orderGuid" : ["98fe6b41-8499-4b85-82f7-f7b18e5da374"]
          }
        }

     ]
    }
  }
}

what am is missing here and how can I search for comma-separated strings

1 Answer 1

2

Simply try with orderGuid.keyword

GET orders/_search
{
  "from": 0,
  "size": 100,
  "query": {
    "bool": {
      "must": [
        {
          "terms": {
            "orderGuid.keyword": [
              "98fe6b41-8499-4b85-82f7-f7b18e5da374"
            ]
          }
        }
      ]
    }
  }
}

OR with match,

GET orders/_search
{
  "from": 0,
  "size": 100,
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "orderGuid": "98fe6b41-8499-4b85-82f7-f7b18e5da374"
          }
        }
      ]
    }
  }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.