Home > Mobile >  Complexity of timestamp range queries in elasticsearch
Complexity of timestamp range queries in elasticsearch

Time:08-03

I know how Elasticsearch index words and strings, but I wonder if there's a different behaviour for timestamps?

We have internal elasticsearch instance that index events ( millions of events per day). I want to pull once in X seconds all the events that we received in the last X seconds.

Does Elasticsearch index the timestamp in efficient way such that we don't need to traverse all the documents to return the relevant results? How it index this data?

CodePudding user response:

Anything numeric, like date fields, integer fields, geo fields, etc, are not stored in the inverted index, but in BKD trees (since ES 5), which are especially suited for range queries and finding collection of unordered docIDs that meet the time range conditions.

  • Related