Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

spring data elasticsearch aggregation max

SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
sourceBuilder.query(QueryBuilders.matchAllQuery());
//sourceBuilder.aggregation(AggregationBuilders.terms("date_count").field("time").format("yyyy-MM-dd"));
sourceBuilder.aggregation(AggregationBuilders.dateHistogram("date_count").calendarInterval(DateHistogramInterval.DAY).field("time"));
SearchRequest searchRequest = new SearchRequest("order_*");
searchRequest.source(sourceBuilder);
SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT);
Aggregations aggregations = searchResponse.getAggregations();
Comment

PREVIOUS NEXT
Code Example
Java :: recursive in java 
Java :: build cmake gradle 
Java :: what is a literal in java 
Java :: java decrypt CryptoJS 
Java :: how to create an abstract class in java 
Java :: popcat 
Java :: get value from dynamic input android 
Java :: Java Multi-catch block 
Java :: Sling authentication handler example 
Java :: 111111000 
Java :: Could not find com.commercehub.gradle.plugin:gradle-avro-plugin:0.10.0. 
Java :: system.out.println(h [2] [1] [1] [0]); 
Java :: how to declare and allocate memory to array in java 
Java :: change FS to hdfs java 
Java :: Java @SafeVarargs annotation 
Java :: how to do 4th root java 
Java :: aws s3 client in java 
Java :: Which Is Better to Configure a Spring Boot Project — Properties or YAML? 
Java :: viewResolver 
Java :: spring jpa group by query method 
Java :: Caused by: android.view.InflateException: Binary XML file line 
Java :: identifier in java 
Java :: annotation spring notnull 
Java :: java jcombobox selected item changed 
Java :: calculate standard deviation in java 
Java :: how to stop screen going off android studio 
Java :: java random value threadlocalrandom 
Java :: windows menu in java swing ausscahlten 
Sql :: mysql set max connections 
Sql :: Find all triggers in database 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =