mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-31 04:14:34 +00:00
Add null check (#20518)
This commit is contained in:
parent
c550ca0112
commit
7a49a94235
@ -2366,8 +2366,12 @@ public class ElasticSearchClient implements SearchClient {
|
||||
.createParser(
|
||||
EsUtils.esXContentRegistry, LoggingDeprecationHandler.INSTANCE, queryFilter);
|
||||
QueryBuilder filter = SearchSourceBuilder.fromXContent(filterParser).query();
|
||||
BoolQueryBuilder newQuery =
|
||||
QueryBuilders.boolQuery().must(searchSourceBuilder.query()).filter(filter);
|
||||
BoolQueryBuilder newQuery;
|
||||
if (!nullOrEmpty(searchSourceBuilder.query())) {
|
||||
newQuery = QueryBuilders.boolQuery().must(searchSourceBuilder.query()).filter(filter);
|
||||
} else {
|
||||
newQuery = QueryBuilders.boolQuery().filter(filter);
|
||||
}
|
||||
searchSourceBuilder.query(newQuery);
|
||||
} catch (Exception ex) {
|
||||
LOG.warn("Error parsing query_filter from query parameters, ignoring filter", ex);
|
||||
|
@ -2457,8 +2457,12 @@ public class OpenSearchClient implements SearchClient {
|
||||
.createParser(
|
||||
OsUtils.osXContentRegistry, LoggingDeprecationHandler.INSTANCE, queryFilter);
|
||||
QueryBuilder filter = SearchSourceBuilder.fromXContent(filterParser).query();
|
||||
BoolQueryBuilder newQuery =
|
||||
QueryBuilders.boolQuery().must(searchSourceBuilder.query()).filter(filter);
|
||||
BoolQueryBuilder newQuery;
|
||||
if (!nullOrEmpty(searchSourceBuilder.query())) {
|
||||
newQuery = QueryBuilders.boolQuery().must(searchSourceBuilder.query()).filter(filter);
|
||||
} else {
|
||||
newQuery = QueryBuilders.boolQuery().filter(filter);
|
||||
}
|
||||
searchSourceBuilder.query(newQuery);
|
||||
} catch (Exception ex) {
|
||||
LOG.warn("Error parsing query_filter from query parameters, ignoring filter", ex);
|
||||
|
Loading…
x
Reference in New Issue
Block a user