@@ -84,7 +84,7 @@ sub run {
84
84
# 'file' type records where the module.name matches the
85
85
# distribution name and which are released &
86
86
# indexed (the 'leading' module)
87
- my $q_body = _filtered_query ($filter );
87
+ my $q_body = _body_filtered_query ($filter );
88
88
89
89
my $node = config-> {config }{es_test_node };
90
90
my $es = MetaCPAN::ES-> new( type => " file" , node => $node );
@@ -95,12 +95,11 @@ sub run {
95
95
qw< author date distribution download_url module.name release status >
96
96
],
97
97
);
98
-
99
98
$found_total += $scroll -> total;
100
99
101
100
log_debug { sprintf ( " Found %s modules" , $scroll -> total ) };
102
101
log_debug { sprintf ( " Found %s total modules" , $found_total ) }
103
- if @$filter != $total and $filter == $module_filters -> [-1];
102
+ if @$filter != $total and $filter == $module_filters -> [-1];
104
103
exit ;
105
104
106
105
my $i = 0;
@@ -201,27 +200,29 @@ ($filter)
201
200
return \@module_filters ;
202
201
}
203
202
204
- sub _filtered_query ($filter ) {
203
+ sub _body_filtered_query ($filter ) {
205
204
return +{
206
- filtered => {
207
- filter => {
208
- bool => {
209
- must => [
210
- {
211
- nested => {
212
- path => ' module' ,
213
- filter => { bool => { must => $filter } }
214
- }
215
- },
216
- { term => { ' maturity' => ' released' } },
217
- ],
218
- must_not => [
219
- { term => { status => ' backpan' } },
220
- { term => { distribution => ' perl' } }
221
- ]
222
- }
205
+ query => {
206
+ filtered => {
207
+ query => { match_all => {} },
208
+ filter => {
209
+ bool => {
210
+ must => [
211
+ {
212
+ nested => {
213
+ path => ' module' ,
214
+ query => { bool => { must => $filter } }
215
+ }
216
+ },
217
+ { term => { ' maturity' => ' released' } },
218
+ ],
219
+ must_not => [
220
+ { term => { status => ' backpan' } },
221
+ { term => { distribution => ' perl' } }
222
+ ]
223
+ }
224
+ },
223
225
},
224
- query => { match_all => {} },
225
226
}
226
227
};
227
228
}
0 commit comments