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