From 3c2f037534475e13459f04f70e42d0b9456a7652 Mon Sep 17 00:00:00 2001 From: Mohit Yadav <105265192+mohityadav766@users.noreply.github.com> Date: Tue, 14 Jan 2025 19:47:48 +0530 Subject: [PATCH] Fix Search Index for ER Model (#19349) --- .../openmetadata/service/search/indexes/SearchIndex.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/SearchIndex.java b/openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/SearchIndex.java index e75cc7262b61..250d0aff53dc 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/SearchIndex.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/SearchIndex.java @@ -1,7 +1,7 @@ package org.openmetadata.service.search.indexes; import static org.openmetadata.common.utils.CommonUtil.nullOrEmpty; -import static org.openmetadata.schema.type.Include.NON_DELETED; +import static org.openmetadata.schema.type.Include.ALL; import static org.openmetadata.service.Entity.FIELD_DESCRIPTION; import static org.openmetadata.service.Entity.FIELD_DISPLAY_NAME; import static org.openmetadata.service.Entity.getEntityByName; @@ -196,7 +196,7 @@ private static void processConstraints( String destinationIndexName = null; try { if (updateForeignTableIndex) { - relatedEntity = getEntityByName(Entity.TABLE, relatedEntityFQN, "*", NON_DELETED); + relatedEntity = getEntityByName(Entity.TABLE, relatedEntityFQN, "*", ALL); IndexMapping destinationIndexMapping = Entity.getSearchRepository() .getIndexMapping(relatedEntity.getEntityReference().getType()); @@ -253,8 +253,7 @@ static List> populateEntityRelationshipData(Table entity) { .findFrom(entity.getId(), Entity.TABLE, Relationship.RELATED_TO.ordinal()); for (CollectionDAO.EntityRelationshipRecord table : relatedTables) { - Table foreignTable = - Entity.getEntity(Entity.TABLE, table.getId(), "tableConstraints", NON_DELETED); + Table foreignTable = Entity.getEntity(Entity.TABLE, table.getId(), "tableConstraints", ALL); processConstraints(foreignTable, entity, constraints, false); } return constraints;