| @@ 154-180 (lines=27) @@ | ||
| 151 | * |
|
| 152 | * @return mixed |
|
| 153 | */ |
|
| 154 | public function visitQuery(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter) |
|
| 155 | { |
|
| 156 | $fieldFilter = $this->getFieldFilter($languageFilter); |
|
| 157 | ||
| 158 | if ($fieldFilter === null) { |
|
| 159 | $query = array( |
|
| 160 | 'nested' => array( |
|
| 161 | 'path' => 'fields_doc', |
|
| 162 | 'query' => $this->getCondition($criterion), |
|
| 163 | ), |
|
| 164 | ); |
|
| 165 | } else { |
|
| 166 | $query = array( |
|
| 167 | 'nested' => array( |
|
| 168 | 'path' => 'fields_doc', |
|
| 169 | 'query' => array( |
|
| 170 | 'filtered' => array( |
|
| 171 | 'query' => $this->getCondition($criterion), |
|
| 172 | 'filter' => $fieldFilter, |
|
| 173 | ), |
|
| 174 | ), |
|
| 175 | ), |
|
| 176 | ); |
|
| 177 | } |
|
| 178 | ||
| 179 | return $query; |
|
| 180 | } |
|
| 181 | } |
|
| 182 | ||
| @@ 145-171 (lines=27) @@ | ||
| 142 | * |
|
| 143 | * @return mixed |
|
| 144 | */ |
|
| 145 | public function visitQuery(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter) |
|
| 146 | { |
|
| 147 | $fieldFilter = $this->getFieldFilter($languageFilter); |
|
| 148 | ||
| 149 | if ($fieldFilter === null) { |
|
| 150 | $query = array( |
|
| 151 | 'nested' => array( |
|
| 152 | 'path' => 'fields_doc', |
|
| 153 | 'query' => $this->getCondition($criterion), |
|
| 154 | ), |
|
| 155 | ); |
|
| 156 | } else { |
|
| 157 | $query = array( |
|
| 158 | 'nested' => array( |
|
| 159 | 'path' => 'fields_doc', |
|
| 160 | 'query' => array( |
|
| 161 | 'filtered' => array( |
|
| 162 | 'query' => $this->getCondition($criterion), |
|
| 163 | 'filter' => $fieldFilter, |
|
| 164 | ), |
|
| 165 | ), |
|
| 166 | ), |
|
| 167 | ); |
|
| 168 | } |
|
| 169 | ||
| 170 | return $query; |
|
| 171 | } |
|
| 172 | } |
|
| 173 | ||