How to get Zero count for date Histogram facet for week, day, month, year,hour and quarter?


(vijuitech) #1

Hi,
I am using Elasticsearch version 19.4. I am using date histogram facet to
get the data based on week, day, month, year,hour and quarter. Is it
possible get the Zero count data in date histogram facet? I have shown here
a response for day,

"facets" : {
"createddaterange" : {
"_type" : "date_histogram",
"entries" : [ {
"time" : 1379203200000,
"count" : 15,
"min" : 1.3792356E12,
"max" : 1.3792356E12,
"total" : 2.0688534E13,
"total_count" : 15,
"mean" : 1.3792356E12
}, {
"time" : 1379289600000,
"count" : 15,
"min" : 1.379322E12,
"max" : 1.379322E12,
"total" : 2.068983E13,
"total_count" : 15,
"mean" : 1.379322E12
} ]
}
}

Could it be possible to get the count for the day without any data as 0
which would be like,

"facets" : {
"createddaterange" : {
"_type" : "date_histogram",
"entries" : [ {
"time" : 1379203200000,
"count" : 15,
"min" : 1.3792356E12,
"max" : 1.3792356E12,
"total" : 2.0688534E13,
"total_count" : 15,
"mean" : 1.3792356E12
}, {
"time" : 1379289600000,
"count" : 0,
"min" : 0,
"max" : 0,
"total" : 0,
"total_count" : 0,
"mean" : 0
} ]
}
}

Cheers,
George

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(David Pilato) #2

Will be AFAIK in upcoming aggregation feature (1.0).

By now, you have to fill blanks on client level.

HTH

David

Le 18 sept. 2013 à 09:10, George Viju vijuitech@gmail.com a écrit :

Hi,
I am using Elasticsearch version 19.4. I am using date histogram facet to get the data based on week, day, month, year,hour and quarter. Is it possible get the Zero count data in date histogram facet? I have shown here a response for day,

"facets" : {
"createddaterange" : {
"_type" : "date_histogram",
"entries" : [ {
"time" : 1379203200000,
"count" : 15,
"min" : 1.3792356E12,
"max" : 1.3792356E12,
"total" : 2.0688534E13,
"total_count" : 15,
"mean" : 1.3792356E12
}, {
"time" : 1379289600000,
"count" : 15,
"min" : 1.379322E12,
"max" : 1.379322E12,
"total" : 2.068983E13,
"total_count" : 15,
"mean" : 1.379322E12
} ]
}
}

Could it be possible to get the count for the day without any data as 0 which would be like,

"facets" : {
"createddaterange" : {
"_type" : "date_histogram",
"entries" : [ {
"time" : 1379203200000,
"count" : 15,
"min" : 1.3792356E12,
"max" : 1.3792356E12,
"total" : 2.0688534E13,
"total_count" : 15,
"mean" : 1.3792356E12
}, {
"time" : 1379289600000,
"count" : 0,
"min" : 0,
"max" : 0,
"total" : 0,
"total_count" : 0,
"mean" : 0
} ]
}
}

Cheers,
George

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(vijuitech) #3

Thank you David. I couldn't get your point " fill blanks on client level.
". Could you please give me an example regarding this which would be help
me better understanding?

On Wednesday, 18 September 2013 12:47:58 UTC+5:30, David Pilato wrote:

Will be AFAIK in upcoming aggregation feature (1.0).

By now, you have to fill blanks on client level.

HTH

David

Le 18 sept. 2013 à 09:10, George Viju <viju...@gmail.com <javascript:>> a
écrit :

Hi,
I am using Elasticsearch version 19.4. I am using date histogram facet to
get the data based on week, day, month, year,hour and quarter. Is it
possible get the Zero count data in date histogram facet? I have shown here
a response for day,

"facets" : {
"createddaterange" : {
"_type" : "date_histogram",
"entries" : [ {
"time" : 1379203200000,
"count" : 15,
"min" : 1.3792356E12,
"max" : 1.3792356E12,
"total" : 2.0688534E13,
"total_count" : 15,
"mean" : 1.3792356E12
}, {
"time" : 1379289600000,
"count" : 15,
"min" : 1.379322E12,
"max" : 1.379322E12,
"total" : 2.068983E13,
"total_count" : 15,
"mean" : 1.379322E12
} ]
}
}

Could it be possible to get the count for the day without any data as 0
which would be like,

"facets" : {
"createddaterange" : {
"_type" : "date_histogram",
"entries" : [ {
"time" : 1379203200000,
"count" : 15,
"min" : 1.3792356E12,
"max" : 1.3792356E12,
"total" : 2.0688534E13,
"total_count" : 15,
"mean" : 1.3792356E12
}, {
"time" : 1379289600000,
"count" : 0,
"min" : 0,
"max" : 0,
"total" : 0,
"total_count" : 0,
"mean" : 0
} ]
}
}

Cheers,
George

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(David Pilato) #4

That basically means that you now on client side that for example you have a year interval.

So if you get as a result:
2010: 10
2012: 2
2013: 3

You know on client side that 2011 is missing, right?

Just add it yourself on client side in the array of results:
2010: 10
2011: 0
2012: 2
2013: 3

That's what I meant.

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 18 sept. 2013 à 09:25, George Viju vijuitech@gmail.com a écrit :

Thank you David. I couldn't get your point " fill blanks on client level. ". Could you please give me an example regarding this which would be help me better understanding?

On Wednesday, 18 September 2013 12:47:58 UTC+5:30, David Pilato wrote:
Will be AFAIK in upcoming aggregation feature (1.0).

By now, you have to fill blanks on client level.

HTH

David

Le 18 sept. 2013 à 09:10, George Viju viju...@gmail.com a écrit :

Hi,
I am using Elasticsearch version 19.4. I am using date histogram facet to get the data based on week, day, month, year,hour and quarter. Is it possible get the Zero count data in date histogram facet? I have shown here a response for day,

"facets" : {
"createddaterange" : {
"_type" : "date_histogram",
"entries" : [ {
"time" : 1379203200000,
"count" : 15,
"min" : 1.3792356E12,
"max" : 1.3792356E12,
"total" : 2.0688534E13,
"total_count" : 15,
"mean" : 1.3792356E12
}, {
"time" : 1379289600000,
"count" : 15,
"min" : 1.379322E12,
"max" : 1.379322E12,
"total" : 2.068983E13,
"total_count" : 15,
"mean" : 1.379322E12
} ]
}
}

Could it be possible to get the count for the day without any data as 0 which would be like,

"facets" : {
"createddaterange" : {
"_type" : "date_histogram",
"entries" : [ {
"time" : 1379203200000,
"count" : 15,
"min" : 1.3792356E12,
"max" : 1.3792356E12,
"total" : 2.0688534E13,
"total_count" : 15,
"mean" : 1.3792356E12
}, {
"time" : 1379289600000,
"count" : 0,
"min" : 0,
"max" : 0,
"total" : 0,
"total_count" : 0,
"mean" : 0
} ]
}
}

Cheers,
George

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(vijuitech) #5

Thank you so much David.

cheers,
George

On Wednesday, 18 September 2013 12:58:50 UTC+5:30, David Pilato wrote:

That basically means that you now on client side that for example you have
a year interval.

So if you get as a result:
2010: 10
2012: 2
2013: 3

You know on client side that 2011 is missing, right?

Just add it yourself on client side in the array of results:
2010: 10
2011: 0
2012: 2
2013: 3

That's what I meant.

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr
| @scrutmydocs https://twitter.com/scrutmydocs

Le 18 sept. 2013 à 09:25, George Viju <viju...@gmail.com <javascript:>> a
écrit :

Thank you David. I couldn't get your point " fill blanks on client level.
". Could you please give me an example regarding this which would be help
me better understanding?

On Wednesday, 18 September 2013 12:47:58 UTC+5:30, David Pilato wrote:

Will be AFAIK in upcoming aggregation feature (1.0).

By now, you have to fill blanks on client level.

HTH

David

Le 18 sept. 2013 à 09:10, George Viju viju...@gmail.com a écrit :

Hi,
I am using Elasticsearch version 19.4. I am using date histogram facet to
get the data based on week, day, month, year,hour and quarter. Is it
possible get the Zero count data in date histogram facet? I have shown here
a response for day,

"facets" : {
"createddaterange" : {
"_type" : "date_histogram",
"entries" : [ {
"time" : 1379203200000,
"count" : 15,
"min" : 1.3792356E12,
"max" : 1.3792356E12,
"total" : 2.0688534E13,
"total_count" : 15,
"mean" : 1.3792356E12
}, {
"time" : 1379289600000,
"count" : 15,
"min" : 1.379322E12,
"max" : 1.379322E12,
"total" : 2.068983E13,
"total_count" : 15,
"mean" : 1.379322E12
} ]
}
}

Could it be possible to get the count for the day without any data as 0
which would be like,

"facets" : {
"createddaterange" : {
"_type" : "date_histogram",
"entries" : [ {
"time" : 1379203200000,
"count" : 15,
"min" : 1.3792356E12,
"max" : 1.3792356E12,
"total" : 2.0688534E13,
"total_count" : 15,
"mean" : 1.3792356E12
}, {
"time" : 1379289600000,
"count" : 0,
"min" : 0,
"max" : 0,
"total" : 0,
"total_count" : 0,
"mean" : 0
} ]
}
}

Cheers,
George

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #6