tcpeiris
(Kavish Peiris)
August 10, 2023, 7:17am
1
I'm getting a parse exception when I add order to CompositeAggregationSource.
Map<String, CompositeAggregationSource> cas = new HashMap<>();
List<NamedValue<SortOrder>> orderby = new ArrayList<>();
orderby.add(NamedValue.of(key, SortOrder.Asc));
cas.put(key, CompositeAggregationSource.of(c -> c.terms(t -> t.field(key).order(orderby))));
swallez
(Sylvain Wallez)
August 10, 2023, 8:14am
2
Can you please provide more details about the "parse exception" so that we can investigate?
tcpeiris
(Kavish Peiris)
August 10, 2023, 8:22am
3
[co.elastic.clients.elasticsearch._types.ElasticsearchException: [es/search] failed: [x_content_parse_exception] [1:194] [composite] failed to parse field [sources]]
This is the exact error I'm getting in the console while running this. without order it works fine.
tcpeiris
(Kavish Peiris)
August 10, 2023, 8:31am
4
This is what generates using the above method.
"CompositeAggregationSource: {"terms":{"field":"KEY","order":[{"KEY":"asc"}]}}"
But it should be
"CompositeAggregationSource": { "terms": { "field": "KEY", "order": "asc" } }
swallez
(Sylvain Wallez)
August 10, 2023, 8:59am
5
Thanks. This is a known issue. We're working on it and this will be fixed in an upcoming release. Subscribe to the issue to follow resolution:
system
(system)
Closed
September 7, 2023, 9:12am
7
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.