|
88 | 88 | # 'file' type records where the module.name matches the |
89 | 89 | # distribution name and which are released & |
90 | 90 | # indexed (the 'leading' module) |
91 | | - my $q_body = _body_filtered_query($filter); |
| 91 | + my $q_body = _body_query($filter); |
92 | 92 |
|
93 | 93 | my $scroll = $es->scroll( |
94 | 94 | body => $q_body, |
@@ -219,31 +219,26 @@ ($filter) |
219 | 219 | return \@module_filters; |
220 | 220 | } |
221 | 221 |
|
222 | | -sub _body_filtered_query ($filter) { |
| 222 | +sub _body_query ($filter) { |
223 | 223 | return +{ |
224 | 224 | query => { |
225 | | - filtered => { |
226 | | - query => { match_all => {} }, |
227 | | - filter => { |
228 | | - bool => { |
229 | | - must => [ |
230 | | - { |
231 | | - nested => { |
232 | | - path => 'module', |
233 | | - query => { bool => { must => $filter } } |
234 | | - } |
235 | | - }, |
236 | | - { term => { 'maturity' => 'released' } }, |
237 | | - ], |
238 | | - must_not => [ |
239 | | - { term => { status => 'backpan' } }, |
240 | | - { term => { distribution => 'perl' } } |
241 | | - ] |
242 | | - } |
243 | | - }, |
244 | | - }, |
245 | | - } |
246 | | - }; |
| 225 | + bool => { |
| 226 | + must => [ |
| 227 | + { |
| 228 | + nested => { |
| 229 | + path => 'module', |
| 230 | + query => { bool => { must => $filter } } |
| 231 | + } |
| 232 | + }, |
| 233 | + { term => { 'maturity' => 'released' } }, |
| 234 | + ], |
| 235 | + must_not => [ |
| 236 | + { term => { status => 'backpan' } }, |
| 237 | + { term => { distribution => 'perl' } } |
| 238 | + ] |
| 239 | + } |
| 240 | + }, |
| 241 | + }, |
247 | 242 | } |
248 | 243 |
|
249 | 244 | sub _queue_latest ( $dist = $distribution ) { |
@@ -326,19 +321,14 @@ ( $bulk, $source, $status ) |
326 | 321 | my $scroll = $es_file->scroll( |
327 | 322 | body => { |
328 | 323 | query => { |
329 | | - filtered => { |
330 | | - query => { match_all => {} }, |
331 | | - filter => { |
332 | | - bool => { |
333 | | - must => [ |
334 | | - { |
335 | | - term => |
336 | | - { 'release' => $source->{release} } |
337 | | - }, |
338 | | - { term => { 'author' => $source->{author} } }, |
339 | | - ], |
| 324 | + bool => { |
| 325 | + must => [ |
| 326 | + { |
| 327 | + term => |
| 328 | + { 'release' => $source->{release} } |
340 | 329 | }, |
341 | | - }, |
| 330 | + { term => { 'author' => $source->{author} } }, |
| 331 | + ], |
342 | 332 | }, |
343 | 333 | }, |
344 | 334 | fields => [qw< name >], |
|
0 commit comments