Skip to content

Commit 4abb406

Browse files
committed
BUGFIX: add empty query parts for should and must_not in default bool query
This allows to use the existing API "appendAtPath" as well with the paths: "query.filtered.query.bool.should" and "query.filtered.query.bool.must_not" which is helpful from time to time. Other than that, this change has no side-effects.
1 parent d089c17 commit 4abb406

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Eel/ElasticSearchQueryBuilder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ class ElasticSearchQueryBuilder implements QueryBuilderInterface, ProtectedConte
101101
[
102102
'match_all' => []
103103
]
104-
]
104+
],
105+
'should' => [],
106+
'must_not' => []
105107
]
106108

107109
],

Tests/Unit/Eel/ElasticSearchQueryBuilderTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ public function basicRequestStructureTakesContextNodeIntoAccount()
5555
'bool' => [
5656
'must' => [
5757
['match_all' => []]
58-
]
58+
],
59+
'should' => [],
60+
'must_not' => []
5961
]
6062
],
6163
'filter' => [

0 commit comments

Comments
 (0)