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

propogate domain if added at service level #14270

Merged
merged 4 commits into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,19 @@ public void propagateInheritedFieldsToChildren(
String entityType, String entityId, ChangeDescription changeDescription, IndexMapping indexMapping) {
if (changeDescription != null) {
Pair<String, Map<String, Object>> updates = getInheritedFieldChanges(changeDescription);
Pair<String, String> parentMatch = new ImmutablePair<>(entityType + ".id", entityId);
Pair<String, String> parentMatch;
if (updates.getValue().get("type").toString().equalsIgnoreCase("domain")
&& (entityType.equalsIgnoreCase(Entity.DATABASE_SERVICE)
|| entityType.equalsIgnoreCase(Entity.DASHBOARD_SERVICE)
|| entityType.equalsIgnoreCase(Entity.MESSAGING_SERVICE)
|| entityType.equalsIgnoreCase(Entity.PIPELINE_SERVICE)
|| entityType.equalsIgnoreCase(Entity.MLMODEL_SERVICE)
|| entityType.equalsIgnoreCase(Entity.STORAGE_SERVICE)
|| entityType.equalsIgnoreCase(Entity.SEARCH_SERVICE))) {
parentMatch = new ImmutablePair<>("service.id", entityId);
} else {
parentMatch = new ImmutablePair<>(entityType + ".id", entityId);
}
if (updates.getKey() != null && !updates.getKey().isEmpty()) {
searchClient.updateChildren(indexMapping.getAlias(), parentMatch, updates);
}
Expand Down
Loading