|
@@ 43-49 (lines=7) @@
|
| 40 |
|
* @example $query->where('channel')->in([1,2,3])->where('page.categoryId')->in([10,11]); |
| 41 |
|
* @return SearchQuery; |
| 42 |
|
*/ |
| 43 |
|
public function in(array $values) |
| 44 |
|
{ |
| 45 |
|
// потому что ES не понимает дырки в ключах |
| 46 |
|
$values = array_values($values); |
| 47 |
|
$this->query->addFilter('terms', [$this->field => $values]); |
| 48 |
|
return $this->query; |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
/** |
| 52 |
|
* Добавить фильтр вхождения значение в диапазон (обе границы включительно). |
|
@@ 173-179 (lines=7) @@
|
| 170 |
|
* @example $query->where('channel')->notIn([1,2,3]); |
| 171 |
|
* @return SearchQuery; |
| 172 |
|
*/ |
| 173 |
|
public function notIn(array $values) |
| 174 |
|
{ |
| 175 |
|
// потому что ES не понимает дырки в ключах |
| 176 |
|
$values = array_values($values); |
| 177 |
|
$this->query->addNotFilter('terms', [$this->field => $values]); |
| 178 |
|
return $this->query; |
| 179 |
|
} |
| 180 |
|
|
| 181 |
|
|
| 182 |
|
/** |