I want to achieve following query in elasticsearch.
select max(creationDate - updatedDate) from sudentTable;
how to write above query?
elasticsearch verison is v1.1.1
select max(creationDate) from sudentTable; is writtren like below
public static void max() {
final searchRequestBuilder builder = getClient().prepareSearch("indexname").
setTypes("type1");
MaxBuilder mx = AggregationBuilders.max("maxDate");
mx.field("creationDate");
builder.addAggregation(mx);
System.out.print("builders:::"+builder);
Aggregations ag = builder.execute().actionGet().getAggregations();
InternalMax inMx = ag.get("maxDate");
System.out.print("aggg::"+inMx.getValue()+"\n");
}
--
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/e0041d6c-5ce3-4aeb-88fb-cc3638a8cf6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.