# Are GET by ID requests impacted by index refresh?

**URL:** <https://discuss.elastic.co/t/are-get-by-id-requests-impacted-by-index-refresh/373042>\
**Category:** Elasticsearch\
**Created:** [January 10, 2025, 5:02am UTC](https://discuss.elastic.co/t/are-get-by-id-requests-impacted-by-index-refresh/373042 "2025-01-10T05:02:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yeikel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yeikel/32/125434_2.png) [@yeikel](https://discuss.elastic.co/u/yeikel)\
**Post date:** [January 10, 2025, 5:02am UTC](https://discuss.elastic.co/t/are-get-by-id-requests-impacted-by-index-refresh/373042/1 "2025-01-10T05:02:37Z")

</div>

From what I understand, searches may be impacted by index refreshes in that the results may be based on a previous state of the index while the refresh is in progress.

But how about get requests by the document ID? Can a get by id request potentially return outdated data?

My understanding is that they are not, but I'd appreciate a confirmation

Thanks!

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [January 10, 2025, 5:59am UTC](https://discuss.elastic.co/t/are-get-by-id-requests-impacted-by-index-refresh/373042/2 "2025-01-10T05:59:43Z")

</div>

Hi @yeikel

No `GET` by `_id` is not impacted by refresh... easy to test.  
Refresh affects `_search`  
`GET` by `_id` is not a search

```auto
PUT test-discuss
{
  "settings": {
    "refresh_interval": "60s"
  }
}

PUT test-discuss/_doc/1
{
  "foo" : "bar"
}

GET test-discuss/_search

GET test-discuss/_doc/1

## RESULTS

# PUT test-discuss 200 OK
{
  "acknowledged": true,
  "shards_acknowledged": true,
  "index": "test-discuss"
}
# PUT test-discuss/_doc/1 201 Created
{
  "_index": "test-discuss",
  "_id": "1",
  "_version": 1,
  "result": "created",
  "_shards": {
    "total": 2,
    "successful": 2,
    "failed": 0
  },
  "_seq_no": 0,
  "_primary_term": 1
}
# GET test-discuss/_search 200 OK
{
  "took": 1,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 0,
      "relation": "eq"
    },
    "max_score": null,
    "hits": []
  }
}
# GET test-discuss/_doc/1 200 OK
{
  "_index": "test-discuss",
  "_id": "1",
  "_version": 1,
  "_seq_no": 0,
  "_primary_term": 1,
  "found": true,
  "_source": {
    "foo": "bar"
  }
}

```

---

<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:** [February 7, 2025, 6:00am UTC](https://discuss.elastic.co/t/are-get-by-id-requests-impacted-by-index-refresh/373042/3 "2025-02-07T06:00:42Z")

</div>

Closed on February 7, 2025, 6:00am UTC

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