Skip to content

Commit

Permalink
Merge pull request #89 from povils/fix/use-param-for-bool-query
Browse files Browse the repository at this point in the history
use param in bool query
  • Loading branch information
mvar committed Apr 17, 2016
2 parents 65a4ac7 + f248360 commit 817e8d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Query/BoolQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ public function toArray()
}
}

$output = $this->processArray($output);

return $output;
}

Expand Down
4 changes: 4 additions & 0 deletions tests/Query/BoolQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
[
Expand All @@ -71,7 +73,9 @@ public function testBoolToArray()
],
],
],
'minimum_should_match' => 1,
];

$this->assertEquals($expected, $bool->toArray());
}

Expand Down

0 comments on commit 817e8d1

Please sign in to comment.