Skip to content

JsonpMappingException:MultiTermsAggregation: Unknown field 'order' #492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
biggerdamage opened this issue Jun 27, 2022 · 3 comments
Open
Labels
Category: Enhancement New feature or request

Comments

@biggerdamage
Copy link

Description

when i try to sort in MultiTermsAggregation,i have this exception:
co.elastic.clients.json.JsonpMappingException: Error deserializing co.elastic.clients.elasticsearch._types.aggregations.MultiTermsAggregation: Unknown field 'order' (JSON path: aggs.group.multi_terms.order) (line no=1, column no=239, offset=238) at co.elastic.clients.json.ObjectDeserializer.parseUnknownField(ObjectDeserializer.java:221) at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:178) at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:136) at co.elastic.clients.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:75) at co.elastic.clients.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:79) at co.elastic.clients.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:43) at co.elastic.clients.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:71) at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:180) at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:136) at co.elastic.clients.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:75) at co.elastic.clients.json.BuildFunctionDeserializer.deserialize(BuildFunctionDeserializer.java:47) at co.elastic.clients.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:43) at co.elastic.clients.json.JsonpDeserializerBase$StringMapDeserializer.deserialize(JsonpDeserializerBase.java:347) at co.elastic.clients.json.JsonpDeserializerBase$StringMapDeserializer.deserialize(JsonpDeserializerBase.java:331) at co.elastic.clients.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:75) at co.elastic.clients.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:71) at co.elastic.clients.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:180) at co.elastic.clients.util.WithJsonObjectBuilderBase.withJson(WithJsonObjectBuilderBase.java:66) at co.elastic.clients.json.WithJson.withJson(WithJson.java:57) at com.fr.elasticsearch.ESMetric.group(ESMetric.java:200) at com.fr.elasticsearch.ESMetricTest.groupPerformanceLog(ESMetricTest.java:174)

i use withJSON to build a SearchRequest:
SearchRequest request = new SearchRequest.Builder().withJson(reader).build()
the reader content is just like this:
... "my_aggs": { "multi_terms": { "terms": [ { "field": "fieldOne.keyword" }, { "field": "fieldTwo.keyword" } ], "order": [ { "mySubAggs": "desc" } ] }, "aggs": { "mySubAggs": { ...

i have exception as above mentioned.I found that there is no "order" filed in co.elastic.clients.elasticsearch._types.aggregations.MultiTermsAggregation so i can not sort in MultiTermsAggregation.Is there any way to solve it?

@biggerdamage
Copy link
Author

biggerdamage commented Jun 27, 2022

PS: I can sort in multi terms aggregations successfully with GET request as mentioned in document
Sub aggregation and sorting examples.But failed with Java API

@elasticmachine
Copy link
Collaborator

Pinging @elastic/clients-team (Team:Clients)

@Enomine88
Copy link

Any updates on that?
Have something similar in #428

Thanks - Enomine

@swallez swallez transferred this issue from elastic/elasticsearch Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants