You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metamodel.apache.org by ar...@apache.org on 2021/03/17 09:30:41 UTC

[metamodel] 01/07: MM-?: Elasticsearch, fix for "is null" or "is empty".

This is an automated email from the ASF dual-hosted git repository.

arjansh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/metamodel.git

commit 922b593d55e1be09cbaaa182cf40f39f520e8a65
Author: jakub <j....@quadient.com>
AuthorDate: Fri Mar 5 13:45:28 2021 +0100

    MM-?: Elasticsearch, fix for "is null" or "is empty".
---
 .../org/apache/metamodel/elasticsearch/common/ElasticSearchUtils.java   | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/elasticsearch/common/src/main/java/org/apache/metamodel/elasticsearch/common/ElasticSearchUtils.java b/elasticsearch/common/src/main/java/org/apache/metamodel/elasticsearch/common/ElasticSearchUtils.java
index d051c32..cdc38c4 100644
--- a/elasticsearch/common/src/main/java/org/apache/metamodel/elasticsearch/common/ElasticSearchUtils.java
+++ b/elasticsearch/common/src/main/java/org/apache/metamodel/elasticsearch/common/ElasticSearchUtils.java
@@ -225,6 +225,8 @@ public class ElasticSearchUtils {
         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.wildcardQuery(column.getName(), "?*"));
             } else {
                 return matchOrTermQuery(column, filterItem.getOperand());
             }