Skip to content

Fix field resolution for ExposedFieldsAggregationContext. #4328

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

Closed
wants to merge 2 commits into from

Conversation

christophstrobl
Copy link
Member

This PR fixes an issue where the context is not relaxed and errors on unknown fields if multiple stages of nesting contexts happen.

Closes: #3917

This commit fixes an issue where the context is not relaxed and errors on unknown fields if multiple stages of nesting contexts happen.
@@ -96,6 +96,25 @@ private FieldReference getReference(@Nullable Field field, String name) {
return exposedField;
}

if(rootContext instanceof RelaxedTypeBasedAggregationOperationContext) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about rootContext.getReference(…)? Wouldn't that work as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC it broke one of the existing tests for _id field projection.

mp911de pushed a commit that referenced this pull request Mar 16, 2023
This commit fixes an issue where the context is not relaxed and errors on unknown fields if multiple stages of nesting contexts happen.

Closes #3917
Original pull request: #4328
mp911de added a commit that referenced this pull request Mar 16, 2023
Simplify field creation considering simplified projection expressions.

See #3917
Original pull request: #4328
mp911de pushed a commit that referenced this pull request Mar 16, 2023
This commit fixes an issue where the context is not relaxed and errors on unknown fields if multiple stages of nesting contexts happen.

Closes #3917
Original pull request: #4328
mp911de added a commit that referenced this pull request Mar 16, 2023
Simplify field creation considering simplified projection expressions.

See #3917
Original pull request: #4328
@mp911de
Copy link
Member

mp911de commented Mar 16, 2023

That's merged and polished now.

@mp911de mp911de closed this Mar 16, 2023
@mp911de mp911de deleted the issue/3917 branch March 16, 2023 08:59
@mp911de mp911de added this to the 4.0.4 (2022.0.4) milestone Mar 16, 2023
@mp911de mp911de added the type: bug A general bug label Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sort without grouped fields
2 participants