Skip to content

Instantly share code, notes, and snippets.

@monken
Created July 26, 2011 13:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monken/1106698 to your computer and use it in GitHub Desktop.
Save monken/1106698 to your computer and use it in GitHub Desktop.
Use ElasticSearch.pm to query MetaCPAN
use ElasticSearch;
my $es = ElasticSearch->new( servers => 'api.metacpan.org', no_refresh => 1 );
my $scroller = $es->scrolled_search(
query => { match_all => {} },
search_type => 'scan',
scroll => '5m',
index => 'v0',
type => 'release',
size => 100,
);
while ( my $result = $scroller->next ) {
print $result->{_source}->{author}, $/;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment