When no write, why Elasticsearch performs indexing every ‘n’ seconds? – Open Source Elasticsearch and Kibana

Hi Deepak,

For my edification, does Inserting or Updating a single document, cause the entire Index to be re-created OR is the Index simply updated very optimally ? I believe it would be the latter.

OpenSearch uses Apache Lucene under the hood. Index (ingest new document) operation is straightforward but update is not – it is equivalent to soft delete / insert new document. I am not sure what you mean by “entire Index to be re-created” though, could you elaborate a bit?

Also is the performance of adding new records and indexes being updated an O(1) or an O( n) operation ?

I don’t think O() notation would strictly apply here, it is a function of index settings (mappings / replication / shards / routing / …), bulk / non-bulk operation and also the document size. But intuitively, indexing new documents should be more lightweight than updating the existing ones.

Best Regards,
Andriy Redko

Read more here: Source link