Skip to content
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

[BUG] Nested/Sub Aggregations are not sending back buckets containing the data #197

Closed
joelbolt35 opened this issue Aug 1, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@joelbolt35
Copy link

joelbolt35 commented Aug 1, 2022

What is the bug?

This is a duplicate bug from the elastic search java client:
elastic/elasticsearch-java#87

How can one reproduce the bug?

Create ANY nested aggregation for terms. There is no way to retrieve results

What is the expected behavior?

Nested Queries work.

What is your host/environment?

Linux (Ubuntu 18.04). Using opensearch-rest-clientv2.1.0 and opensearch-javav2.0.0

Do you have any screenshots?

Screenshot from 2022-08-01 12-05-28
the docCount is correct but I can't see the data since the deserializer tossed it.

@joelbolt35 joelbolt35 added bug Something isn't working untriaged labels Aug 1, 2022
@dblock
Copy link
Member

dblock commented Aug 1, 2022

Would appreciate a PR with the fix. Please be mindful of not copying non-APLv2 code.

@joelbolt35
Copy link
Author

joelbolt35 commented Aug 3, 2022

@dblock
The elastic search specification update that this fix needs is fixed here: elastic/elasticsearch-specification#1243

And I see here that they use code generation from that spec: elastic/elasticsearch-java@7444423

How is this code generation done? I need to generate it since this this code gen appears to fix the issue.

@dblock
Copy link
Member

dblock commented Aug 4, 2022

@joelbolt35 TBH I don't know. I don't think we generated any code here since the fork, and the spec has diverged. We thus don't want to use the upstream elasticsearch-specification. I suppose it would be ok to make small fixes by hand?

In the short term, we did start forking elasticsearch-specification at the time, but didn't finish it. We still can at its last APLv2 iteration if that's the right thing to do. WDYT?

The long term plan I'd like to take is opensearch-project/opensearch-clients#19. It's similar to what elastic is doing, except we chose different tooling. For opensearch-java this means swapping the elastic spec for https://github.com/opensearch-project/opensearch-api-specification (or its output). It would be amazing if someone could attempt that, even if to see what the gap is.

@pchaitu
Copy link

pchaitu commented Aug 17, 2022

I am also struggling with the same issue with Nested and Multi term aggregation, as well, any chances of quick fix on this?

@abhinav-nath
Copy link
Contributor

abhinav-nath commented Oct 6, 2022

Can someone please help - how to parse sub-aggregations from filter aggregations? This is a big issue for rendering multi-select facets and refraining me from using this new client.

There is no way to extract sub-aggregations:

image

@dblock
Copy link
Member

dblock commented Oct 6, 2022

@abhinav-nath Someone (you?) needs to contribute a fix for this in OpenSearch (without copying ES code). I don't think there's another way.

@abhinav-nath
Copy link
Contributor

abhinav-nath commented Oct 7, 2022

@dblock - I have created a PR (#234). Please review it.

@oana-danescu-idnow
Copy link

Any idea when this will be released?

@dblock
Copy link
Member

dblock commented Nov 1, 2022

Please add your +1 to #253

@VachaShah
Copy link
Collaborator

This was released in v2.2.0.

@wbeckler wbeckler mentioned this issue Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants