mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-07 13:07:22 +00:00
Fix Topic index to map properly (#9688)
* Fix Topic index to map properly * fix python side
This commit is contained in:
parent
41ce2406a4
commit
f2e54fe7b9
@ -97,9 +97,8 @@ class TopicESDocument(BaseModel):
|
||||
href: Optional[str]
|
||||
deleted: bool
|
||||
service: EntityReference
|
||||
messageSchema: Optional[schema.Topic] = None
|
||||
schemaText: Optional[str] = None
|
||||
schemaType: Optional[str] = None
|
||||
schemaType: Optional[schema.SchemaType] = None
|
||||
cleanupPolicies: List[str] = None
|
||||
replicationFactor: Optional[int] = None
|
||||
maximumMessageSize: Optional[int] = None
|
||||
|
||||
@ -556,7 +556,8 @@ class ElasticsearchSink(Sink[Entity]):
|
||||
deleted=topic.deleted,
|
||||
service=topic.service,
|
||||
serviceType=str(topic.serviceType.name),
|
||||
messageSchema=topic.messageSchema,
|
||||
schemaText=topic.messageSchema.schemaText if topic.messageSchema else None,
|
||||
schemaType=topic.messageSchema.schemaType if topic.messageSchema else None,
|
||||
cleanupPolicies=[str(policy.name) for policy in topic.cleanupPolicies],
|
||||
replicationFactor=topic.replicationFactor,
|
||||
maximumMessageSize=topic.maximumMessageSize,
|
||||
|
||||
@ -9,7 +9,7 @@ import org.openmetadata.service.Entity;
|
||||
import org.openmetadata.service.util.JsonUtils;
|
||||
|
||||
public class TopicIndex implements ElasticSearchIndex {
|
||||
final List<String> excludeTopicFields = List.of("sampleData", "changeDescription");
|
||||
final List<String> excludeTopicFields = List.of("sampleData", "changeDescription", "messageSchema");
|
||||
final Topic topic;
|
||||
|
||||
public TopicIndex(Topic topic) {
|
||||
@ -37,6 +37,8 @@ public class TopicIndex implements ElasticSearchIndex {
|
||||
doc.put("service_suggest", serviceSuggest);
|
||||
doc.put("entityType", Entity.TOPIC);
|
||||
doc.put("serviceType", topic.getServiceType());
|
||||
doc.put("schemaText", topic.getMessageSchema() != null ? topic.getMessageSchema().getSchemaText() : null);
|
||||
doc.put("schemaType", topic.getMessageSchema() != null ? topic.getMessageSchema().getSchemaType() : null);
|
||||
return doc;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user