Skip to content

Commit

Permalink
propogate domain if added at service level (#14270)
Browse files Browse the repository at this point in the history
  • Loading branch information
07Himank committed Dec 6, 2023
1 parent 54d89c8 commit 9777b05
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,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

0 comments on commit 9777b05

Please sign in to comment.