如下查询使用java transportClient api (java api 版本5.6)执行失败, 提示:{ "error" : "JsonGenerationException[Can not write a field name, expecting a value]"}
"aggs": {
"distict_count": {
"cardinality": {
"field": "id" //id是long类型
}
}
}
对应api:
CardinalityAggregationBuilder aggregation = AggregationBuilders.cardinality("distict_count") .field(CompoundConstants.COMPOUND_ID_NAME_PMS); searchRequestBuilder.addAggregation(aggregation);
怎么解决呢?
"aggs": {
"distict_count": {
"cardinality": {
"field": "id" //id是long类型
}
}
}
对应api:
CardinalityAggregationBuilder aggregation = AggregationBuilders.cardinality("distict_count") .field(CompoundConstants.COMPOUND_ID_NAME_PMS); searchRequestBuilder.addAggregation(aggregation);
怎么解决呢?
0 个回复