-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Minor : Fix exception in search due to exception in database.displayN… #18290
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1282,6 +1282,24 @@ private static SearchSourceBuilder buildSearchAcrossIndexesBuilder( | |
FunctionScoreQueryBuilder queryBuilder = boostScore(queryStringBuilder); | ||
queryBuilder.boostMode(CombineFunction.SUM); | ||
SearchSourceBuilder searchSourceBuilder = searchBuilder(queryBuilder, null, from, size); | ||
searchSourceBuilder.aggregation( | ||
AggregationBuilders.terms("database.name.keyword") | ||
.field("database.name.keyword") | ||
.size(MAX_AGGREGATE_SIZE)); | ||
searchSourceBuilder.aggregation( | ||
AggregationBuilders.terms("databaseSchema.name.keyword") | ||
.field("databaseSchema.name.keyword") | ||
.size(MAX_AGGREGATE_SIZE)); | ||
return addAggregation(searchSourceBuilder); | ||
Comment on lines
+1285
to
+1293
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question here https://github.com/open-metadata/OpenMetadata/pull/18290/files#r1803006416 |
||
} | ||
|
||
private static SearchSourceBuilder buildDataAssetsSearchBuilder( | ||
String query, int from, int size) { | ||
QueryStringQueryBuilder queryStringBuilder = | ||
buildSearchQueryBuilder(query, SearchIndex.getAllFields()); | ||
FunctionScoreQueryBuilder queryBuilder = boostScore(queryStringBuilder); | ||
queryBuilder.boostMode(CombineFunction.SUM); | ||
SearchSourceBuilder searchSourceBuilder = searchBuilder(queryBuilder, null, from, size); | ||
searchSourceBuilder.aggregation( | ||
AggregationBuilders.terms("database.name.keyword") | ||
.field("database.name.keyword") | ||
|
@@ -2288,7 +2306,8 @@ private static SearchSourceBuilder getSearchSourceBuilder( | |
"storage_service_index", | ||
"search_service_index", | ||
"metadata_service_index" -> buildServiceSearchBuilder(q, from, size); | ||
case "all", "dataAsset" -> buildSearchAcrossIndexesBuilder(q, from, size); | ||
case "dataAsset" -> buildDataAssetsSearchBuilder(q, from, size); | ||
case "all" -> buildSearchAcrossIndexesBuilder(q, from, size); | ||
default -> buildAggregateSearchBuilder(q, from, size); | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do the aggregation on the fullyQualifiedName? Using name I believe if we have
service.database.schema
andotherService.database.schema
then they'll both get aggregated under the same if we usename
I believe.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @TeddyCr thanks for pointing your concern is valid, but for our usage we are not dependent
only on a single aggregation while getting result, we check the condition with other aggregations as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have tried to replicate the same scenario with same database and schema, seems to be working fine.
Also will be removing the support for aggregations on name.keyword, as in most scenario we are moving to show results based on displayName