Thank you Eric Jain!
I tried using the code for the date April 1(Sunday) to 13(Friday)
but again I am getting 3 week as count
"createddaterange" : {
"_type" : "date_histogram",
"entries" : [ {
"time" : 1332633600000,
"count" : 30,
"min" : 1.3332708E12,
"max" : 1.3333572E12,
"total" : 3.999942E13,
"total_count" : 30,
"mean" : 1.333314E12
}, {
"time" : 1333238400000,
"count" : 113,
"min" : 1.3334436E12,
"max" : 1.333967978E12,
"total" : 1.50710536311E14,
"total_count" : 113,
"mean" : 1.3337215602743362E12
}, {
"time" : 1333843200000,
"count" : 62,
"min" : 1.3340484E12,
"max" : 1.3343076E12,
"total" : 8.2718964797E13,
"total_count" : 62,
"mean" : 1.334176851564516E12
} ]
}
The Facet is
"createddaterange" : {
"date_histogram" : {
"key_field" : "createddate",
"value_field" : "createddate",
"interval" : "week",
"pre_offset" : -86400000,
"post_offset" : -86400000
}
}
Cheers!
George
On Apr 18, 9:57 am, Eric Jain eric.j...@gmail.com wrote:
On Tue, Apr 17, 2012 at 20:53, George Viju vijuit...@gmail.com wrote:
Is there any method to make the week to start from Sunday and
ends at Saturday? How to use postOffset() method with DateHistogram
Facet?
How about like so?
DateHistogramFacetBuilder facet = ...
TimeValue oneDayEarlier = TimeValue.timeValueHours(-24);
facet.preOffset(oneDayEarlier).postOffset(oneDayEarlier);