Permalink
Browse files

fix CPANTesters error

  • Loading branch information...
1 parent c1c563b commit 75f1f7e35697b6ea7c7fc1361d189879da84210b @andreeap andreeap committed Apr 13, 2015
Showing with 6 additions and 15 deletions.
  1. +6 −15 lib/MetaCPAN/Script/CPANTesters.pm
@@ -40,14 +40,7 @@ sub index_reports {
bunzip2 "$db.bz2" => "$db", AutoClose => 1;
- my $scroll = $es->scrolled_search(
- index => $index,
- type => 'release',
- query => { match_all => {} },
- size => 500,
- search_type => 'scan',
- scroll => '5m',
- );
+ my $scroll = $self->index->type('release')->size(500)->raw->scroll;
my %releases;
while ( my $release = $scroll->next ) {
@@ -56,8 +49,7 @@ sub index_reports {
join( '-',
grep {defined} $data->{distribution},
$data->{version} )
- }
- = $data;
+ } = $data;
}
log_info { 'Opening database file at ' . $db };
@@ -87,22 +79,21 @@ sub index_reports {
sub bulk {
my ( $self, $bulk ) = @_;
- my @bulk;
+ my $bulk = $self->model->bulk;
my $index = $self->index->name;
while ( my $data = shift @$bulk ) {
- push(
- @bulk,
+ $bulk->add(
{
index => {
index => $index,
id => $data->{id},
type => 'release',
- data => $data
+ body => $data
}
}
);
}
- $self->es->bulk( \@bulk );
+
}
__PACKAGE__->meta->make_immutable;

0 comments on commit 75f1f7e

Please sign in to comment.