Hi

I need to get date histogram with interval is day, but I want to limit from 
a start date to finish date. So how can I do it in java? Here is my source 
code but it seem doesn't work correctly

RangeFilterBuilder dateRangeFilter = FilterBuilders.rangeFilter("date");
dateRangeFilter.gte(start.getTime()).lte(finish.getTime());

SearchResponse response = client.prepareSearch(indices)
                .setTypes("html")
                .setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
                
.setQuery(QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(), 
dateRangeFilter))
                
.addAggregation(dateHistogram("histo").field("date").interval(DateHistogram.Interval.DAY))
                .execute()
                .actionGet();

Thanks

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/72bb3c10-8c47-4601-b7a5-36d23e927fb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to