diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java index 46863ad4f7c0..6951547e37d2 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java @@ -274,7 +274,19 @@ public void propagateInheritedFieldsToChildren( String entityType, String entityId, ChangeDescription changeDescription, IndexMapping indexMapping) { if (changeDescription != null) { Pair> updates = getInheritedFieldChanges(changeDescription); - Pair parentMatch = new ImmutablePair<>(entityType + ".id", entityId); + Pair 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); }