Is there any difference between these search methods

Method 1

GET _search
{
  "query": {
    "term": {"service.name": "IMS-4-199"}}
}

Method 2

GET /_search
{
  "query": { 
    "bool": { 
      "must": {"match": { "service.name": "IMS-4-199" }}
    }
  }
}

Method 3

GET /_search
{
  "query": { 
    "bool": {
      "filter": 
        { "term":  { "service.name": "IMS-4-199" }},
    }
  }
}

Yes.

Method 1: IMS-4-199 is not analyzed. It contributes to the final score and can not be cached.
Method 2: IMS-4-199 might be analyzed (depends on your mapping). It contributes to the final score and can not be cached.
Method 3: IMS-4-199 is not analyzed. It does not contributes to the final score and can be cached.

Method 3 is the most efficient thing to do if you don't care about scoring and just want to filter by a given value.

Thanks, perfect answer

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