# When is data actually indexed in Elasticsearch?

**URL:** <https://discuss.elastic.co/t/when-is-data-actually-indexed-in-elasticsearch/78>\
**Category:** Elasticsearch\
**Created:** [April 30, 2015, 11:59pm UTC](https://discuss.elastic.co/t/when-is-data-actually-indexed-in-elasticsearch/78 "2015-04-30T23:59:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [April 30, 2015, 11:59pm UTC](https://discuss.elastic.co/t/when-is-data-actually-indexed-in-elasticsearch/78/1 "2015-04-30T23:59:47Z")

</div>

Once the index (POST) call is made and returns, the document is guaranteed to be searchable from the index. When you query back, there are 2 ways to do it:

```auto
curl -XGET localhost:9200/myindex/order/2qLrAfPVQvCRMe7Ku8r0Tw

```

The above method is realtime, i.e., it will return the doc immediately after the prior POST

```auto
curl -XPOST localhost:9200/myindex/order/_search

```

The above method is near-realtime, i.e., it will return the doc approximately 1 second after the prior POST command. The 1 second "delay" is a called a refresh interval that can be configured per index. The default refresh interval for any index is 1 second, meaning when you run `_search`, documents will be included in the results 1 second after the POST command returned successfully.

If you want to refresh immediately after a document is indexed, you may also do something like (it will be a little less efficient, but it will be realtime for a succeeding `_search`):

```auto
curl -XPOST 'http://localhost:9200/myindex/order/2qLrAfPVQvCRMe7Ku8r0Tw?refresh=true'

```

---

<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:** [July 6, 2017, 12:16am UTC](https://discuss.elastic.co/t/when-is-data-actually-indexed-in-elasticsearch/78/2 "2017-07-06T00:16:22Z")

</div>


