File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 1414use MetaCPAN::Ingest qw<
1515 cpan_dir
1616 read_recent_segment
17+ true
1718> ;
1819
1920# args
9394
9495sub backpan_changes () {
9596 my $scroll_release = $es_release -> scroll(
96- size => 1000,
9797 scroll => ' 1m' ,
98- fields => [qw< author archive > ],
9998 body => {
10099 query => {
101100 bool => {
104103 ],
105104 },
106105 },
106+ size => 1000,
107+ _source => [qw< author archive > ],
107108 },
108109 );
109110
110111 my @changes ;
111112 while ( my $release = $scroll_release -> next ) {
112- my $data = $release -> {fields };
113+ my $data = $release -> {_source };
113114 my $path
114115 = $cpan -> child( ' authors' ,
115116 MetaCPAN::Util::author_dir( $data -> {author } ),
@@ -187,8 +188,6 @@ ($release)
187188
188189 my $scroll_file = $es_file -> scroll( {
189190 scroll => ' 1m' ,
190- size => 1000,
191- fields => [qw< _parent _source > ],
192191 body => {
193192 query => {
194193 bool => {
@@ -206,6 +205,9 @@ ($release)
206205 ],
207206 },
208207 },
208+ size => 1000,
209+ _source => true,
210+ sort => ' _doc' ,
209211 },
210212 } );
211213 return if $dry_run ;
@@ -218,9 +220,6 @@ ($release)
218220 $bulk_file -> index ( {
219221 id => $row -> {_id },
220222 source => {
221- $row -> {fields }{_parent }
222- ? ( parent => $row -> {fields }{_parent } )
223- : (),
224223 %$source ,
225224 status => ' backpan' ,
226225 }
@@ -230,7 +229,8 @@ ($release)
230229 $bulk_release -> index ( {
231230 id => $release -> {_id },
232231 source => {
233- %{ $release -> {_source } }, status => ' backpan' ,
232+ %{ $release -> {_source } },
233+ status => ' backpan' ,
234234 }
235235 } );
236236
You can’t perform that action at this time.
0 commit comments