File tree 3 files changed +24
-0
lines changed
test/lib/Elastica/Test/Query
3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 3
3
2015-04-09
4
4
- Added Elastica\Query\SimpleQueryString::setMinimumShouldMatch
5
5
- Added Elastica\Query\FunctionScore::setMinScore
6
+ - Added Elastica\Query\MoreLikeThis::setMinimumShouldMatch
6
7
7
8
2015-04-08
8
9
- Added new methods to Elastica\Aggregation\DateHistogram: setOffset, setTimezone
Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ public function setMaxQueryTerms($maxQueryTerms)
63
63
*
64
64
* @param float $percentTermsToMatch Percentage
65
65
* @return $this
66
+ *
67
+ * @deprecated Option "percent_terms_to_match" deprecated as of ES 1.5. Use "minimum_should_match" instead.
66
68
*/
67
69
public function setPercentTermsToMatch ($ percentTermsToMatch )
68
70
{
@@ -158,4 +160,15 @@ public function setStopWords(array $stopWords)
158
160
{
159
161
return $ this ->setParam ('stop_words ' , $ stopWords );
160
162
}
163
+
164
+ /**
165
+ * Set minimum_should_match option.
166
+ *
167
+ * @param int|string $minimumShouldMatch
168
+ * @return $this
169
+ */
170
+ public function setMinimumShouldMatch ($ minimumShouldMatch )
171
+ {
172
+ return $ this ->setParam ('minimum_should_match ' , $ minimumShouldMatch );
173
+ }
161
174
}
Original file line number Diff line number Diff line change @@ -104,6 +104,16 @@ public function testSetPercentTermsToMatch()
104
104
$ this ->assertEquals ($ match , $ query ->getParam ('percent_terms_to_match ' ));
105
105
}
106
106
107
+ public function testSetMinimumShouldMatch ()
108
+ {
109
+ $ query = new MoreLikeThis ();
110
+
111
+ $ match = '80% ' ;
112
+ $ query ->setMinimumShouldMatch ($ match );
113
+
114
+ $ this ->assertEquals ($ match , $ query ->getParam ('minimum_should_match ' ));
115
+ }
116
+
107
117
public function testSetMinDocFrequency ()
108
118
{
109
119
$ query = new MoreLikeThis ();
You can’t perform that action at this time.
0 commit comments