Fix #16493 :User Deletion Error in Search - Adding Conditional Check (#16492)

* Fix User Deletion Error in Search - Adding Conditional Check

* Fix User Deletion Error in Search - Adding Conditional Check
This commit is contained in:
sonika-shah 2024-05-31 17:13:14 +05:30 committed by GitHub
parent 656da03b14
commit 9aa85b37be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -586,9 +586,11 @@ public class SearchRepository {
List.of(new ImmutablePair<>("service.id", docId)));
}
default -> {
searchClient.deleteEntityByFields(
indexMapping.getChildAliases(clusterAlias),
List.of(new ImmutablePair<>(entityType + ".id", docId)));
List<String> indexNames = indexMapping.getChildAliases(clusterAlias);
if (!indexNames.isEmpty()) {
searchClient.deleteEntityByFields(
indexNames, List.of(new ImmutablePair<>(entityType + ".id", docId)));
}
}
}
}