Are GET by ID requests impacted by index refresh?

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!

Hi @yeikel

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

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