Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

Commit

Permalink
MM-?: Elasticsearch, IS NULL or empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub committed Mar 12, 2021
1 parent 5e8dacf commit 4aa2024
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ private static QueryBuilder createQueryBuilderForOperator(final FilterItem filte
if (OperatorType.EQUALS_TO.equals(filterItem.getOperator())) {
if (filterItem.getOperand() == null) {
return getMissingQuery(column.getName());
} else if (filterItem.getOperand().equals("")) {
return QueryBuilders.boolQuery().mustNot(QueryBuilders.existsQuery(column.getName()));
} else {
return matchOrTermQuery(column, filterItem.getOperand());
}
Expand All @@ -250,7 +248,7 @@ private static QueryBuilder createQueryBuilderForOperator(final FilterItem filte
}

private static QueryBuilder matchOrTermQuery(final Column column, final Object operand) {
if (column.getType().isLiteral()) {
if (column.getType().isLiteral() && operand != null && !operand.equals("")) {
return QueryBuilders.matchQuery(column.getName(), operand);
} else {
return QueryBuilders.termQuery(column.getName(), operand);
Expand Down

0 comments on commit 4aa2024

Please sign in to comment.