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

Add the ability to parse aggregations with OpenSearch #1082

Merged
merged 17 commits into from
Oct 1, 2024

Conversation

kyle-sammons
Copy link
Collaborator

Summary

This PR adds the ability to parse aggregations with OpenSearch when the optional feature flag astra.query.useOpenSearchAggregationParsing is enabled. This follows the same pattern as the query refactor we did awhile back, keeping both the old parsing and new parsing paths in the code, and only switching between based on the feature flag. As such it should be reasonably inert and safe to deploy.

I also did some minor fixes to to the changes made in #1081, and added some tests; both of which were missed due to time constraints.

Requirements

Copy link
Contributor

@bryanlb bryanlb left a comment

Choose a reason for hiding this comment

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

Couple minor suggestions - only major issue I noticed is the ObjectMapper initialization

if (!searchRequest.getAggregationJson().isEmpty()) {
SearchModule searchModule = new SearchModule(Settings.EMPTY, List.of());
try {
ObjectMapper objectMapper = new ObjectMapper();
Copy link
Contributor

Choose a reason for hiding this comment

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

Object mappers should only be initialized once - consider refactoring this so that these initialization for mappers/parsers only have to be paid one time at class construction.

ermontross
ermontross previously approved these changes Sep 26, 2024
Copy link
Contributor

@ermontross ermontross left a comment

Choose a reason for hiding this comment

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

LGTM, with Bryan's comments

@bryanlb
Copy link
Contributor

bryanlb commented Sep 30, 2024

Closes #629

@bryanlb
Copy link
Contributor

bryanlb commented Sep 30, 2024

Closes #628

@kyle-sammons kyle-sammons merged commit ec57383 into master Oct 1, 2024
2 checks passed
@kyle-sammons kyle-sammons deleted the ksammons-parse-aggregations-with-opensearch branch October 1, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement geo hash grid aggregation Implement bucket script aggregation
3 participants