Skip to content

Commit

Permalink
Typo in Terms query fixed (issue #74)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin committed Aug 22, 2011
1 parent 476f4a7 commit 1061678
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
CHANGES

2011-08-22
- Typo in Terms query fixed (issue #74)

2011-08-15
- Refactoring HTTP connection to keep alive connection -> speed improvement during using the same client
- Release v0.17.6.0 added
Expand Down
2 changes: 1 addition & 1 deletion lib/Elastica/Query/Terms.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function setParam($key, $value) {
* @param int $minimum Minimum value
*/
public function setMinimumMatch($minimum) {
return $this->setParam('minimum_match', (int) $minimium);
return $this->setParam('minimum_match', (int) $minimum);
}

/**
Expand Down
12 changes: 12 additions & 0 deletions test/lib/Elastica/Query/TermsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,16 @@ public function testFilteredSearch() {

$this->assertEquals(3, $resultSet->count());
}

public function testSetMinimum() {
$key = 'name';
$terms = array('nicolas', 'ruflin');
$minimum = 2;

$query = new Elastica_Query_Terms($key, $terms);
$query->setMinimumMatch($minimum);

$data = $query->toArray();
$this->assertEquals($minimum, $data['terms']['minimum_match']);
}
}

0 comments on commit 1061678

Please sign in to comment.