Find exact result

My goal is to find the exact match result from all of my documents. How can I achieve this?

I have found 3 ways to achieve it but I'm confused about which one will be more effective.

### Exact search 1
GET email/_search
{
  "query": {
    "term" : {
      "email.keyword": "aaaaaaaa@yahoo.com"
    }
  }
}
### Exact search 2
GET email/_search
{
  "query": {
      "bool": {
        "must": [
         {
           "match": {
             "email.keyword": "aaaaaaaa@yahoo.com"
           }
         }
      ]
    }
  }
}
### Exact search 3
GET email/_search
{
  "query" : {
      "constant_score": {
          "filter" : {
              "term" : {
                  "email.keyword": "aaaaaaaa@yahoo.com"
              }
          }
      }
  }
}

I'd bet on the 3rd.
Or a bool query with a filter array and a term query.

1 Like

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