equal
deleted
inserted
replaced
157 if(array_key_exists('location', $filters) && !empty($filters['location'])) { |
157 if(array_key_exists('location', $filters) && !empty($filters['location'])) { |
158 $location = $filters['location']; |
158 $location = $filters['location']; |
159 if(is_array($location)) { |
159 if(is_array($location)) { |
160 $location = $location[0]; // we know it is not empty |
160 $location = $location[0]; // we know it is not empty |
161 } |
161 } |
162 $location = $filters['location']; |
|
163 $qFilterParts[] = CorpusFilterManager::getLocationFilterPart($location); |
162 $qFilterParts[] = CorpusFilterManager::getLocationFilterPart($location); |
|
163 } |
|
164 if(array_key_exists('themes', $filters) && !empty($filters['themes'])) { |
|
165 $themes = $filters['themes']; |
|
166 if(is_string($themes)) { |
|
167 $themes = [$themes,]; // we know it is not empty |
|
168 } |
|
169 $qFilterParts[] = CorpusFilterManager::getThemeFilterPart($themes); |
164 } |
170 } |
165 |
171 |
166 $query = [ |
172 $query = [ |
167 'index' => config('corpusparole.elasticsearch_index'), |
173 'index' => config('corpusparole.elasticsearch_index'), |
168 'body' => [ |
174 'body' => [ |