AggregationBuilder group = AggregationBuilders.terms("agg1")
.field("requestId").subAggregation(AggregationBuilders
.max("agg2").field("startTime"));
The value of field requestId is split and the result is wrong. And I put mapping like:
client.admin().indices().preparePutMapping(indexName)
.setType(type)
.setSource("{\n" +
" \"" + type + "\":{\n" +
" \"properties\": {\n" +
" \"requestId\": {\n" +
" \"type\": \"text\",\n" +
" \"fielddata\": true,\n" +
" \"index\": \"not_analyzed\"\n" +
" }\n" +
" }\n" +
" }\n" +
"}")
.get();
I can't get the right result.