| @@ 134-160 (lines=27) @@ | ||
| 131 | * |
|
| 132 | * @return mixed |
|
| 133 | */ |
|
| 134 | public function visitQuery(Criterion $criterion, Dispatcher $dispatcher, array $languageFilter) |
|
| 135 | { |
|
| 136 | $fieldFilter = $this->getFieldFilter($languageFilter); |
|
| 137 | ||
| 138 | if ($fieldFilter === null) { |
|
| 139 | $query = array( |
|
| 140 | 'nested' => array( |
|
| 141 | 'path' => 'fields_doc', |
|
| 142 | 'query' => $this->getCondition($criterion), |
|
| 143 | ), |
|
| 144 | ); |
|
| 145 | } else { |
|
| 146 | $query = array( |
|
| 147 | 'nested' => array( |
|
| 148 | 'path' => 'fields_doc', |
|
| 149 | 'query' => array( |
|
| 150 | 'filtered' => array( |
|
| 151 | 'query' => $this->getCondition($criterion), |
|
| 152 | 'filter' => $fieldFilter, |
|
| 153 | ), |
|
| 154 | ), |
|
| 155 | ), |
|
| 156 | ); |
|
| 157 | } |
|
| 158 | ||
| 159 | return $query; |
|
| 160 | } |
|
| 161 | } |
|
| 162 | ||
| @@ 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 | ||