Fix data insight filtering (#9415)

Fix: DI filtering
This commit is contained in:
Teddy 2022-12-20 10:11:33 +01:00 committed by GitHub
parent 36e01a2b21
commit 1df8014f78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,6 @@ import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilde
import org.elasticsearch.search.aggregations.metrics.MaxAggregationBuilder;
import org.elasticsearch.search.aggregations.metrics.SumAggregationBuilder;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.openmetadata.common.utils.CommonUtil;
import org.openmetadata.schema.dataInsight.DataInsightChart;
import org.openmetadata.schema.dataInsight.DataInsightChartResult;
import org.openmetadata.schema.type.EntityReference;
@ -120,7 +119,7 @@ public class DataInsightChartRepository extends EntityRepository<DataInsightChar
BoolQueryBuilder searchQueryFiler = new BoolQueryBuilder();
if (team != null && SUPPORTS_TEAM_FILTER.contains(dataInsightChartName)) {
List<String> teamArray = CommonUtil.listOf(team);
List<String> teamArray = Arrays.asList(team.split("\\s*,\\s*"));
BoolQueryBuilder teamQueryFilter = QueryBuilders.boolQuery();
teamQueryFilter.should(QueryBuilders.termsQuery(DATA_TEAM, teamArray));
@ -128,7 +127,7 @@ public class DataInsightChartRepository extends EntityRepository<DataInsightChar
}
if (tier != null && SUPPORTS_TIER_FILTER.contains(dataInsightChartName)) {
List<String> tierArray = CommonUtil.listOf(tier);
List<String> tierArray = Arrays.asList(tier.split("\\s*,\\s*"));
BoolQueryBuilder tierQueryFilter = QueryBuilders.boolQuery();
tierQueryFilter.should(QueryBuilders.termsQuery(DATA_ENTITY_TIER, tierArray));