# Is there any difference between these search methods

**URL:** <https://discuss.elastic.co/t/is-there-any-difference-between-these-search-methods/230927>\
**Category:** Elasticsearch\
**Created:** [May 4, 2020, 6:02am UTC](https://discuss.elastic.co/t/is-there-any-difference-between-these-search-methods/230927 "2020-05-04T06:02:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wajika](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wajika](https://discuss.elastic.co/u/wajika)\
**Post date:** [May 4, 2020, 6:02am UTC](https://discuss.elastic.co/t/is-there-any-difference-between-these-search-methods/230927/1 "2020-05-04T06:02:47Z")

</div>

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" }},
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 4, 2020, 8:35am UTC](https://discuss.elastic.co/t/is-there-any-difference-between-these-search-methods/230927/2 "2020-05-04T08:35:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wajika](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wajika](https://discuss.elastic.co/u/wajika)\
**Post date:** [May 4, 2020, 9:48am UTC](https://discuss.elastic.co/t/is-there-any-difference-between-these-search-methods/230927/3 "2020-05-04T09:48:10Z")

</div>

Thanks, perfect answer

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 1, 2020, 9:48am UTC](https://discuss.elastic.co/t/is-there-any-difference-between-these-search-methods/230927/4 "2020-06-01T09:48:31Z")

</div>

Closed on June 1, 2020, 9:48am UTC

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