mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-16 10:53:31 +00:00
Fix Search Index for ER Model (#19349)
This commit is contained in:
parent
a8b30370a3
commit
3c2f037534
@ -1,7 +1,7 @@
|
|||||||
package org.openmetadata.service.search.indexes;
|
package org.openmetadata.service.search.indexes;
|
||||||
|
|
||||||
import static org.openmetadata.common.utils.CommonUtil.nullOrEmpty;
|
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_DESCRIPTION;
|
||||||
import static org.openmetadata.service.Entity.FIELD_DISPLAY_NAME;
|
import static org.openmetadata.service.Entity.FIELD_DISPLAY_NAME;
|
||||||
import static org.openmetadata.service.Entity.getEntityByName;
|
import static org.openmetadata.service.Entity.getEntityByName;
|
||||||
@ -196,7 +196,7 @@ public interface SearchIndex {
|
|||||||
String destinationIndexName = null;
|
String destinationIndexName = null;
|
||||||
try {
|
try {
|
||||||
if (updateForeignTableIndex) {
|
if (updateForeignTableIndex) {
|
||||||
relatedEntity = getEntityByName(Entity.TABLE, relatedEntityFQN, "*", NON_DELETED);
|
relatedEntity = getEntityByName(Entity.TABLE, relatedEntityFQN, "*", ALL);
|
||||||
IndexMapping destinationIndexMapping =
|
IndexMapping destinationIndexMapping =
|
||||||
Entity.getSearchRepository()
|
Entity.getSearchRepository()
|
||||||
.getIndexMapping(relatedEntity.getEntityReference().getType());
|
.getIndexMapping(relatedEntity.getEntityReference().getType());
|
||||||
@ -253,8 +253,7 @@ public interface SearchIndex {
|
|||||||
.findFrom(entity.getId(), Entity.TABLE, Relationship.RELATED_TO.ordinal());
|
.findFrom(entity.getId(), Entity.TABLE, Relationship.RELATED_TO.ordinal());
|
||||||
|
|
||||||
for (CollectionDAO.EntityRelationshipRecord table : relatedTables) {
|
for (CollectionDAO.EntityRelationshipRecord table : relatedTables) {
|
||||||
Table foreignTable =
|
Table foreignTable = Entity.getEntity(Entity.TABLE, table.getId(), "tableConstraints", ALL);
|
||||||
Entity.getEntity(Entity.TABLE, table.getId(), "tableConstraints", NON_DELETED);
|
|
||||||
processConstraints(foreignTable, entity, constraints, false);
|
processConstraints(foreignTable, entity, constraints, false);
|
||||||
}
|
}
|
||||||
return constraints;
|
return constraints;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user