where i do my search with the java API. Now i like to make some Aggregation on my search result.
with
AggregationBuilder aggregation = AggregationBuilders.nested("Identifier").path("Attributes");
aggregation.subAggregation(AggregationBuilders.terms("agg_ident").field("Attributes.Identifier"));
i get my Identiefiers.
but i need the count of the Values too.
For example if i have data like this:
attr6 valueA
attr6 valueA
attr6 valueA
attr6 valueB
attr6 valueB
attr7 valueA
attr7 valueA
i need the Result
I have attr6 with valueA 3 Times
I have attr6 with valueB 2 Times
I have attr7 with valueA 2 Times
If i try
AggregationBuilder aggregation = AggregationBuilders.nested("Identifier").path("Attributes");
aggregation.subAggregation(AggregationBuilders.terms("agg_ident").field("Attributes.Identifier"));
aggregation.subAggregation(AggregationBuilders.terms("agg_werte").field("Attributes.Value"));
i get 2 rsults but i lose my relation.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.