3 ms·
I started using elasticsearch recently and I was wondering, does the indexing happen in real time during the index request? How do you know how long the indexin
by brndn 11y ago
I started using elasticsearch recently and I was wondering, does the indexing happen in real time during the index request? How do you know how long the indexing process takes?
- acehyzer 11y agoIt happens pretty much real time. While using cURL or the .NET client it doesn't return a response until the indexing is finished. You can verify this by querying your index for some basic info. For example you could even just put the following in the browser: http://hostname:9200/_cat/indices http://hostname:9200/_cat/indices The 6th column gives you the number of records indexed. Send your request and refresh the browser.
- chrisatumd 11y agoThere's an index.refresh_interval setting. It defaults to 1s, so by default your data will be available for querying within one second after being indexed.
- nemo44x 10y agoIn general, yes. But keep in mind that the Elasticsearch JVM GC could fire up right after the document is indexed and possibly run for a few seconds if there is a lot of memory pressure. When the GC is done Elasticsearch will continue to process queries but it may be the indexed data hasn't been refreshed yet. So, a query run "1 second" after the index operation may not in fact return the document. However, this would be a very rare case.