diff --git a/modules/core/core-repo/src/test/java/com/enonic/xp/repo/impl/elasticsearch/query/translator/factory/dsl/BooleanQueryBuilderTest.java b/modules/core/core-repo/src/test/java/com/enonic/xp/repo/impl/elasticsearch/query/translator/factory/dsl/BooleanQueryBuilderTest.java index 0a3e6f386fb..59b6d74cb49 100644 --- a/modules/core/core-repo/src/test/java/com/enonic/xp/repo/impl/elasticsearch/query/translator/factory/dsl/BooleanQueryBuilderTest.java +++ b/modules/core/core-repo/src/test/java/com/enonic/xp/repo/impl/elasticsearch/query/translator/factory/dsl/BooleanQueryBuilderTest.java @@ -25,6 +25,13 @@ public void mustNot() test( "mustNot" ); } + @Test + public void mustNotArray() + throws Exception + { + test( "mustNot_array" ); + } + @Test public void should() throws Exception diff --git a/modules/core/core-repo/src/test/resources/com/enonic/xp/repo/impl/elasticsearch/query/translator/factory/dsl/boolean/query/mustNot_array.json b/modules/core/core-repo/src/test/resources/com/enonic/xp/repo/impl/elasticsearch/query/translator/factory/dsl/boolean/query/mustNot_array.json new file mode 100644 index 00000000000..ffbdb67bc29 --- /dev/null +++ b/modules/core/core-repo/src/test/resources/com/enonic/xp/repo/impl/elasticsearch/query/translator/factory/dsl/boolean/query/mustNot_array.json @@ -0,0 +1,22 @@ +{ + "boolean" : { + "mustNot" : [ + { + "boolean" : { + "should" : { + "fulltext" : { + "fields" : [ + "displayName" + ], + "query" : "fisk" + }, + "term" : { + "field" : "custom_number", + "value" : 2.4 + } + } + } + } + ] + } +} diff --git a/modules/core/core-repo/src/test/resources/com/enonic/xp/repo/impl/elasticsearch/query/translator/factory/dsl/boolean/result/mustNot_array.json b/modules/core/core-repo/src/test/resources/com/enonic/xp/repo/impl/elasticsearch/query/translator/factory/dsl/boolean/result/mustNot_array.json new file mode 100644 index 00000000000..64c661aa9ea --- /dev/null +++ b/modules/core/core-repo/src/test/resources/com/enonic/xp/repo/impl/elasticsearch/query/translator/factory/dsl/boolean/result/mustNot_array.json @@ -0,0 +1,28 @@ +{ + "bool" : { + "must_not" : { + "bool" : { + "should" : [ + { + "simple_query_string" : { + "query" : "fisk", + "fields" : [ + "displayname._analyzed" + ], + "analyzer" : "fulltext_search_default", + "analyze_wildcard" : true + } + }, + { + "term" : { + "custom_number._number" : { + "value" : 2.4, + "_name" : "custom_number._number" + } + } + } + ] + } + } + } +}