Your code looks good. What makes you think that it doesn't work?
On Wed, May 7, 2014 at 11:30 AM, Ha Lan Quyen <[email protected]> wrote: > 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<https://groups.google.com/d/msgid/elasticsearch/72bb3c10-8c47-4601-b7a5-36d23e927fb1%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Adrien Grand -- 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/CAL6Z4j4pyONTYuc9_GFEVES8kQ5Kig4%3D1OOEA8jg6iindGBoeg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
