Fix TestCase indexing: exclude change descripiton from indexing (#12281)

* Fix TestCase indexing: exclude change descripiton from indexing

* Fix TestCase indexing: exclude change descripiton from indexing

---------

Co-authored-by: Mohit Yadav <105265192+mohityadav766@users.noreply.github.com>
This commit is contained in:
Sriharsha Chintalapani 2023-07-05 00:12:51 -05:00 committed by GitHub
parent 0ae716a791
commit bc6ebee369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,8 @@ import org.openmetadata.service.util.JsonUtils;
public class TestCaseIndex implements ElasticSearchIndex {
TestCase testCase;
private static final List<String> excludeFields = List.of("changeDescription");
public TestCaseIndex(TestCase testCase) {
this.testCase = testCase;
}
@ -31,6 +33,7 @@ public class TestCaseIndex implements ElasticSearchIndex {
List<TestSuite> testSuiteArray = new ArrayList<>();
testSuiteArray.add(testSuite);
Map<String, Object> doc = JsonUtils.getMap(testCase);
ElasticSearchIndexUtils.removeNonIndexableFields(doc, excludeFields);
doc.put("testSuites", testSuiteArray);
return doc;
}