Live/historical charts by elasticsearch documents

Hi everyone.
I want to create real time and historical charts (for example by chart.js library) from the elasticsearch documents.
each document has its own date field. So I want to have a linear chart (x axis : time field, y axis: another (value) filed) monthly, from example between (1-Jan-2020 to 1-Feb-2020).

If I want to query a list of (x,y) values between this time range, the problem is that the amount of data in this period is very large (2592000 records monthly).
Do I have to break down my chart into smaller periods (for example daily)?
what is the best way to do this scenario?

Are you having problems running the query? Elasticsearch should be able to handle that pretty easily.

If you base your visualisations on aggregations rather than try to return and process individual documents this should not be a problem. This is e.g. what Kibana does.

1 Like

@Christian_Dahlqvist
I'm new to the elasticsearch.
How can I do it? can you share an example or reference link please?

I would recommend having a look at the documentation.

@warkolm
Sure!
Elasticsearch can do it, but there is not enough advanced tutorial/examples about this case in the web.

As Christian mentioned, using aggregations is the best way.

I will read aggregations tonight and hope the reference can be a good help.
Thank you.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.