I'm showing a chart that details activity between a start and an end
date and I'm using ElasticSearch, along with the histogram query, to
categorize my activity into 24 hour intervals. It seems ElasticSearch
doesn't return all intervals (within my date range query), but instead
only those that actually have data. Much of the time that probably
makes the most sense and I'm guessing ElasticSearch doesn't even
create the interval if there is no data for it.
However, my question is, is it possible to return all intervals, even
those that have 0 data. I can obviously fill in the gaps in code after
I have retrieved the results, it just seems like it might be more
efficient if I could provide some type of parameter to the histogram
query to instruct it to return all intervals.
It can certainly be implemented, but its a shame to do it since it might
create considerable more data to return. It just felt to me that it makes
much more sense to fill in the gaps on the client side, especially when most
charting components out there can do it automatically.
I'm showing a chart that details activity between a start and an end
date and I'm using Elasticsearch, along with the histogram query, to
categorize my activity into 24 hour intervals. It seems Elasticsearch
doesn't return all intervals (within my date range query), but instead
only those that actually have data. Much of the time that probably
makes the most sense and I'm guessing Elasticsearch doesn't even
create the interval if there is no data for it.
However, my question is, is it possible to return all intervals, even
those that have 0 data. I can obviously fill in the gaps in code after
I have retrieved the results, it just seems like it might be more
efficient if I could provide some type of parameter to the histogram
query to instruct it to return all intervals.
That's why I was thinking it might be good as some type of parameter
that I could send in to instruct it to do that. But I understand the
sentiment of handling it client side as well. Thanks for the quick
response.
It can certainly be implemented, but its a shame to do it since it might
create considerable more data to return. It just felt to me that it makes
much more sense to fill in the gaps on the client side, especially when most
charting components out there can do it automatically.
I'm showing a chart that details activity between a start and an end
date and I'm using Elasticsearch, along with the histogram query, to
categorize my activity into 24 hour intervals. It seems Elasticsearch
doesn't return all intervals (within my date range query), but instead
only those that actually have data. Much of the time that probably
makes the most sense and I'm guessing Elasticsearch doesn't even
create the interval if there is no data for it.
However, my question is, is it possible to return all intervals, even
those that have 0 data. I can obviously fill in the gaps in code after
I have retrieved the results, it just seems like it might be more
efficient if I could provide some type of parameter to the histogram
query to instruct it to return all intervals.
Right. By the way, you can use the range facet to maybe work around that.
For example, if you know in advance the ranges you want (for example, break
a month into 4 weeks), then you can simply provide those 4 ranges.
That's why I was thinking it might be good as some type of parameter
that I could send in to instruct it to do that. But I understand the
sentiment of handling it client side as well. Thanks for the quick
response.
It can certainly be implemented, but its a shame to do it since it might
create considerable more data to return. It just felt to me that it makes
much more sense to fill in the gaps on the client side, especially when
most
charting components out there can do it automatically.
I'm showing a chart that details activity between a start and an end
date and I'm using Elasticsearch, along with the histogram query, to
categorize my activity into 24 hour intervals. It seems Elasticsearch
doesn't return all intervals (within my date range query), but instead
only those that actually have data. Much of the time that probably
makes the most sense and I'm guessing Elasticsearch doesn't even
create the interval if there is no data for it.
However, my question is, is it possible to return all intervals, even
those that have 0 data. I can obviously fill in the gaps in code after
I have retrieved the results, it just seems like it might be more
efficient if I could provide some type of parameter to the histogram
query to instruct it to return all intervals.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.