Skip to content

Commit 1061678

Browse files
committed
Typo in Terms query fixed (issue #74)
1 parent 476f4a7 commit 1061678

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

changes.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
CHANGES
22

3+
2011-08-22
4+
- Typo in Terms query fixed (issue #74)
5+
36
2011-08-15
47
- Refactoring HTTP connection to keep alive connection -> speed improvement during using the same client
58
- Release v0.17.6.0 added

lib/Elastica/Query/Terms.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function setParam($key, $value) {
6363
* @param int $minimum Minimum value
6464
*/
6565
public function setMinimumMatch($minimum) {
66-
return $this->setParam('minimum_match', (int) $minimium);
66+
return $this->setParam('minimum_match', (int) $minimum);
6767
}
6868

6969
/**

test/lib/Elastica/Query/TermsTest.php

+12
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,16 @@ public function testFilteredSearch() {
3737

3838
$this->assertEquals(3, $resultSet->count());
3939
}
40+
41+
public function testSetMinimum() {
42+
$key = 'name';
43+
$terms = array('nicolas', 'ruflin');
44+
$minimum = 2;
45+
46+
$query = new Elastica_Query_Terms($key, $terms);
47+
$query->setMinimumMatch($minimum);
48+
49+
$data = $query->toArray();
50+
$this->assertEquals($minimum, $data['terms']['minimum_match']);
51+
}
4052
}

0 commit comments

Comments
 (0)