Skip to content

Commit

Permalink
fixes #796
Browse files Browse the repository at this point in the history
  • Loading branch information
webdevsHub committed Mar 12, 2015
1 parent fedd2a1 commit 2e28f10
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
CHANGES

2015-03-12
- Fixed short match construction in query DSL #796

2015-02-22
- Added Elastica\Query\Image

Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/QueryBuilder/DSL/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function match($field = null, $value = null)
{
if ($field !== null && $value !== null) {
$match = new Match();
$match->setFieldParam('field', $field, $value);
$match->setParam($field, $value);

return $match;
}
Expand Down
4 changes: 1 addition & 3 deletions test/lib/Elastica/Test/QueryBuilder/DSL/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ public function testMatch()
$queryDSL = new DSL\Query();

$shortMatch = $queryDSL->match('field', 'match');
$this->assertEquals($shortMatch->getParam('field'), array(
'field' => 'match',
));
$this->assertEquals('match', $shortMatch->getParam('field'));

$this->assertInstanceOf('Elastica\Query\Match', $queryDSL->match());
}
Expand Down

0 comments on commit 2e28f10

Please sign in to comment.