Skip to content

Instantly share code, notes, and snippets.

@kentfredric
Created October 15, 2014 04:21
Show Gist options
  • Save kentfredric/65295334188a7fba4024 to your computer and use it in GitHub Desktop.
Save kentfredric/65295334188a7fba4024 to your computer and use it in GitHub Desktop.
diff --git a/lib/MetaCPAN/Client/Request.pm b/lib/MetaCPAN/Client/Request.pm
index ddd733a..6ab91de 100644
--- a/lib/MetaCPAN/Client/Request.pm
+++ b/lib/MetaCPAN/Client/Request.pm
@@ -81,23 +81,28 @@ sub ssearch {
my $type = shift;
my $args = shift;
my $params = shift;
+ return $self->_ssearch_raw({
+ type => $type,
+ body => $self->_build_body($args),
+ %{ $params },
+ });
+}
+sub _ssearch_raw {
+ my ( $self, $config ) = @_;
my $es = Search::Elasticsearch->new(
nodes => $self->domain,
cxn_pool => 'Static::NoPing',
send_get_body_as => 'POST',
( $self->_has_user_ua ? ( handle => $self->_user_ua ) : () )
);
-
my $scroller = Search::Elasticsearch::Scroll->new(
es => $es,
search_type => 'scan',
scroll => '5m',
index => $self->version,
- type => $type,
size => 1000,
- body => $self->_build_body($args),
- %{ $params },
+ %{ $config }
);
return $scroller;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment