@@ 115-122 (lines=8) @@ | ||
112 | * @link https://www.elastic.co/guide/en/elasticsearch/reference/5.0/query-dsl-terms-query.html |
|
113 | * @return self $this |
|
114 | */ |
|
115 | public function addFilter($type, $filter) |
|
116 | { |
|
117 | if (!isset($this->params['body']['query']['bool']['must'])) { |
|
118 | $this->params['body']['query']['bool']['must'] = []; |
|
119 | } |
|
120 | $this->params['body']['query']['bool']['must'][] = [$type => $filter]; |
|
121 | return $this; |
|
122 | } |
|
123 | ||
124 | /** |
|
125 | * Добавить отрицательный фильтр в raw формате, если готовые методы фильтрации не подходят. |
|
@@ 132-139 (lines=8) @@ | ||
129 | * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html |
|
130 | * @return self $this |
|
131 | */ |
|
132 | public function addNotFilter($type, $filter) |
|
133 | { |
|
134 | if (!isset($this->params['body']['query']['bool']['must_not'])) { |
|
135 | $this->params['body']['query']['bool']['must_not'] = []; |
|
136 | } |
|
137 | $this->params['body']['query']['bool']['must_not'][] = [$type => $filter]; |
|
138 | return $this; |
|
139 | } |
|
140 | ||
141 | ||
142 | /** |