Add schemaText to topic Index (#9482)

* Add schemaText to topic Index

* Remove ChangeDescription from TopicIndex
This commit is contained in:
Sriharsha Chintalapani 2022-12-22 00:42:51 -08:00 committed by GitHub
parent 871da6f6db
commit b4e274c8d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 1 deletions

View File

@ -88,6 +88,9 @@ TOPIC_ELASTICSEARCH_INDEX_MAPPING = textwrap.dedent(
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"schemaText": {
"type": "text"
},
"schemaFields": {
"properties": {
"name": {

View File

@ -9,6 +9,7 @@ import org.openmetadata.service.util.JsonUtils;
public class MlModelIndex implements ElasticSearchIndex {
final MlModel mlModel;
final List<String> excludeFields = List.of("changeDescription");
public MlModelIndex(MlModel mlModel) {
this.mlModel = mlModel;
@ -17,6 +18,7 @@ public class MlModelIndex implements ElasticSearchIndex {
public Map<String, Object> buildESDoc() {
Map<String, Object> doc = JsonUtils.getMap(mlModel);
List<ElasticSearchSuggest> suggest = new ArrayList<>();
ElasticSearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
suggest.add(ElasticSearchSuggest.builder().input(mlModel.getFullyQualifiedName()).weight(5).build());
suggest.add(ElasticSearchSuggest.builder().input(mlModel.getName()).weight(10).build());

View File

@ -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");
final List<String> excludeTopicFields = List.of("sampleData", "changeDescription");
final Topic topic;
public TopicIndex(Topic topic) {

View File

@ -72,6 +72,9 @@
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"schemaText": {
"type": "text"
},
"schemaFields": {
"properties": {
"name": {