Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor: Add glossary index to SearchIndexFactory #14690

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.openmetadata.service.search.indexes.DatabaseServiceIndex;
import org.openmetadata.service.search.indexes.DomainIndex;
import org.openmetadata.service.search.indexes.EntityReportDataIndex;
import org.openmetadata.service.search.indexes.GlossaryIndex;
import org.openmetadata.service.search.indexes.GlossaryTermIndex;
import org.openmetadata.service.search.indexes.MessagingServiceIndex;
import org.openmetadata.service.search.indexes.MetadataServiceIndex;
Expand Down Expand Up @@ -82,6 +83,7 @@ public SearchIndex buildIndex(String entityType, Object entity) {
case Entity.PIPELINE -> new PipelineIndex((Pipeline) entity);
case Entity.USER -> new UserIndex((User) entity);
case Entity.TEAM -> new TeamIndex((Team) entity);
case Entity.GLOSSARY -> new GlossaryIndex((GlossaryTerm) entity);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we please confirm if this casting won;t fail, and the entity is actually GlossaryTerm and not Glossary

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yikes!!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mohityadav766 pushed a fix. PTAL

case Entity.GLOSSARY_TERM -> new GlossaryTermIndex((GlossaryTerm) entity);
case Entity.MLMODEL -> new MlModelIndex((MlModel) entity);
case Entity.TAG -> new TagIndex((Tag) entity);
Expand Down Expand Up @@ -119,11 +121,11 @@ public SearchIndex buildIndex(String entityType, Object entity) {
(ReportData) entity);
case Entity.TEST_CASE_RESOLUTION_STATUS -> new TestCaseResolutionStatusIndex(
(TestCaseResolutionStatus) entity);
default -> buildExternalIndexes(entityType, entity);
default -> buildExternalIndexes(entityType);
};
}

protected SearchIndex buildExternalIndexes(String entityType, Object entity) {
protected SearchIndex buildExternalIndexes(String entityType) {
throw new IllegalArgumentException(
String.format("Entity Type [%s] is not valid for Index Factory", entityType));
}
Expand Down
Loading