|
4 | 4 | import com.google.common.collect.ContiguousSet;
|
5 | 5 | import com.google.common.collect.DiscreteDomain;
|
6 | 6 | import com.google.common.collect.Range;
|
7 |
| -import org.elasticsearch.action.search.SearchRequestBuilder; |
8 | 7 | import org.elasticsearch.action.search.SearchResponse;
|
9 | 8 | import org.elasticsearch.search.SearchHit;
|
10 | 9 | import org.elasticsearch.search.SearchHits;
|
11 | 10 | import org.elasticsearch.search.aggregations.*;
|
12 | 11 | import org.elasticsearch.search.aggregations.bucket.filter.InternalFilter;
|
13 |
| -import org.elasticsearch.search.aggregations.bucket.geogrid.GeoHashGrid; |
14 | 12 | import org.elasticsearch.search.aggregations.bucket.geogrid.InternalGeoHashGrid;
|
15 | 13 | import org.elasticsearch.search.aggregations.bucket.histogram.Histogram;
|
16 | 14 | import org.elasticsearch.search.aggregations.bucket.histogram.InternalHistogram;
|
17 | 15 | import org.elasticsearch.search.aggregations.bucket.nested.InternalNested;
|
18 | 16 | import org.elasticsearch.search.aggregations.bucket.nested.InternalReverseNested;
|
19 |
| -import org.elasticsearch.search.aggregations.bucket.terms.StringTerms; |
20 | 17 | import org.elasticsearch.search.aggregations.bucket.terms.Terms;
|
21 | 18 | import org.elasticsearch.search.aggregations.metrics.avg.Avg;
|
22 | 19 | import org.elasticsearch.search.aggregations.metrics.geobounds.InternalGeoBounds;
|
23 | 20 | import org.elasticsearch.search.aggregations.metrics.max.Max;
|
24 | 21 | import org.elasticsearch.search.aggregations.metrics.min.Min;
|
25 | 22 | import org.elasticsearch.search.aggregations.metrics.percentiles.Percentiles;
|
26 |
| -import org.elasticsearch.search.aggregations.metrics.scripted.ScriptedMetric; |
27 | 23 | import org.elasticsearch.search.aggregations.metrics.stats.Stats;
|
28 | 24 | import org.elasticsearch.search.aggregations.metrics.stats.extended.ExtendedStats;
|
29 | 25 | import org.elasticsearch.search.aggregations.metrics.sum.InternalSum;
|
@@ -354,8 +350,8 @@ public void countGroupByRange() throws IOException, SqlParseException, SQLFeatur
|
354 | 350 | */
|
355 | 351 | @Test
|
356 | 352 | public void countGroupByDateTest() throws IOException, SqlParseException, SQLFeatureNotSupportedException {
|
357 |
| - SqlElasticSearchRequestBuilder result = (SqlElasticSearchRequestBuilder) MainTestSuite.getSearchDao().explain("select insert_time from online group by date_histogram(field='insert_time','interval'='1.5h','format'='yyyy-MM') ").explain(); |
358 |
| - System.out.println(result); |
| 353 | + String result = MainTestSuite.getSearchDao().explain("select insert_time from online group by date_histogram(field='insert_time','interval'='1.5h','format'='yyyy-MM','min_doc_count'=5) ").explain().toString(); |
| 354 | + Assert.assertTrue(result.replaceAll("\\s+", "").contains("{\"date_histogram\":{\"field\":\"insert_time\",\"format\":\"yyyy-MM\",\"interval\":\"1.5h\",\"offset\":0,\"order\":{\"_key\":\"asc\"},\"keyed\":false,\"min_doc_count\":5}")); |
359 | 355 | }
|
360 | 356 |
|
361 | 357 | @Test
|
|
0 commit comments