@@ -238,55 +238,59 @@ public function exactMatch($propertyName, $value)
238238 *
239239 * @param string $propertyName Name of the property
240240 * @param mixed $value Value for comparison
241+ * @param string $clauseType one of must, should, must_not
241242 * @return ElasticSearchQueryBuilder
242- * @api
243243 * @throws QueryBuildingException
244+ * @api
244245 */
245- public function greaterThan ($ propertyName , $ value )
246+ public function greaterThan ($ propertyName , $ value, string $ clauseType = ' must ' )
246247 {
247- return $ this ->queryFilter ('range ' , [$ propertyName => ['gt ' => $ this ->convertValue ($ value )]]);
248+ return $ this ->queryFilter ('range ' , [$ propertyName => ['gt ' => $ this ->convertValue ($ value )]], $ clauseType );
248249 }
249250
250251 /**
251252 * add a range filter (gte) for the given property
252253 *
253254 * @param string $propertyName Name of the property
254255 * @param mixed $value Value for comparison
256+ * @param string $clauseType one of must, should, must_not
255257 * @return ElasticSearchQueryBuilder
256258 * @throws QueryBuildingException
257259 * @api
258260 */
259- public function greaterThanOrEqual ($ propertyName , $ value )
261+ public function greaterThanOrEqual ($ propertyName , $ value, string $ clauseType = ' must ' )
260262 {
261- return $ this ->queryFilter ('range ' , [$ propertyName => ['gte ' => $ this ->convertValue ($ value )]]);
263+ return $ this ->queryFilter ('range ' , [$ propertyName => ['gte ' => $ this ->convertValue ($ value )]], $ clauseType );
262264 }
263265
264266 /**
265267 * add a range filter (lt) for the given property
266268 *
267269 * @param string $propertyName Name of the property
268270 * @param mixed $value Value for comparison
271+ * @param string $clauseType one of must, should, must_not
269272 * @return ElasticSearchQueryBuilder
270273 * @api
271274 * @throws QueryBuildingException
272275 */
273- public function lessThan ($ propertyName , $ value )
276+ public function lessThan ($ propertyName , $ value, string $ clauseType = ' must ' )
274277 {
275- return $ this ->queryFilter ('range ' , [$ propertyName => ['lt ' => $ this ->convertValue ($ value )]]);
278+ return $ this ->queryFilter ('range ' , [$ propertyName => ['lt ' => $ this ->convertValue ($ value )]], $ clauseType );
276279 }
277280
278281 /**
279282 * add a range filter (lte) for the given property
280283 *
281284 * @param string $propertyName Name of the property
282285 * @param mixed $value Value for comparison
286+ * @param string $clauseType one of must, should, must_not
283287 * @return ElasticSearchQueryBuilder
284288 * @throws QueryBuildingException
285289 * @api
286290 */
287- public function lessThanOrEqual ($ propertyName , $ value )
291+ public function lessThanOrEqual ($ propertyName , $ value, string $ clauseType = ' must ' )
288292 {
289- return $ this ->queryFilter ('range ' , [$ propertyName => ['lte ' => $ this ->convertValue ($ value )]]);
293+ return $ this ->queryFilter ('range ' , [$ propertyName => ['lte ' => $ this ->convertValue ($ value )]], $ clauseType );
290294 }
291295
292296 /**
@@ -299,11 +303,11 @@ public function lessThanOrEqual($propertyName, $value)
299303 * @param string $filterType
300304 * @param mixed $filterOptions
301305 * @param string $clauseType one of must, should, must_not
302- * @throws \Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception\ QueryBuildingException
306+ * @throws QueryBuildingException
303307 * @return ElasticSearchQueryBuilder
304308 * @api
305309 */
306- public function queryFilter ($ filterType , $ filterOptions , $ clauseType = 'must ' )
310+ public function queryFilter ($ filterType , $ filterOptions , string $ clauseType = 'must ' )
307311 {
308312 $ this ->request ->queryFilter ($ filterType , $ filterOptions , $ clauseType );
309313
@@ -317,7 +321,7 @@ public function queryFilter($filterType, $filterOptions, $clauseType = 'must')
317321 *
318322 * @param string $path
319323 * @param array $data
320- * @throws \Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception\ QueryBuildingException
324+ * @throws QueryBuildingException
321325 * @return ElasticSearchQueryBuilder
322326 */
323327 public function appendAtPath ($ path , array $ data )
0 commit comments