Skip to content

Commit

Permalink
Adds scripts/endpoints/release/6-latest-releases-with-git-repo-es.pl
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Jul 28, 2013
1 parent 65d109c commit e3d2f58
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions scripts/endpoints/release/6-latest-releases-with-git-repo-es.pl
@@ -0,0 +1,33 @@
#!/usr/bin/env perl

use strict;
use warnings;
use feature qw( say );

use Data::Printer;
use MetaCPAN::Util qw( es );

my @must = (
{ term => { 'release.resources.repository.type' => 'git' }, },
{ term => { status => 'latest' } },
{ term => { authorized => 'true' } },
);

my $scroller = es()->scrolled_search(
query => {
filtered => {
query => { match_all => {} },
filter => { bool => { must => \@must } },
},
},
fields => [ 'author', 'date', 'distribution', 'name', 'resources' ],
search_type => 'scan',
scroll => '5m',
index => 'v0',
type => 'release',
size => 10,
);

while ( my $result = $scroller->next ) {
my $release = $result->{_source};
}

0 comments on commit e3d2f58

Please sign in to comment.