From f2483609789c37c8ac3d053735aa11e82940eb5b Mon Sep 17 00:00:00 2001 From: Povilas Date: Sat, 16 Apr 2016 14:44:36 +0300 Subject: [PATCH] use param in bool query --- src/Query/BoolQuery.php | 2 ++ tests/Query/BoolQueryTest.php | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/Query/BoolQuery.php b/src/Query/BoolQuery.php index ed65f902..2564ee95 100644 --- a/src/Query/BoolQuery.php +++ b/src/Query/BoolQuery.php @@ -112,6 +112,8 @@ public function toArray() } } + $output = $this->processArray($output); + return $output; } diff --git a/tests/Query/BoolQueryTest.php b/tests/Query/BoolQueryTest.php index dd0147fa..8e7bc684 100644 --- a/tests/Query/BoolQueryTest.php +++ b/tests/Query/BoolQueryTest.php @@ -49,6 +49,8 @@ public function testBoolToArray() $bool->add(new TermQuery('key1', 'value1'), BoolQuery::SHOULD); $bool->add(new TermQuery('key2', 'value2'), BoolQuery::MUST); $bool->add(new TermQuery('key3', 'value3'), BoolQuery::MUST_NOT); + $bool->addParameter('minimum_should_match', 1); + $expected = [ 'should' => [ [ @@ -71,7 +73,9 @@ public function testBoolToArray() ], ], ], + 'minimum_should_match' => 1, ]; + $this->assertEquals($expected, $bool->toArray()); }