Created
October 15, 2014 04:38
-
-
Save kentfredric/22266f846eb6003dc842 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/MetaCPAN/Client/Request.pm b/lib/MetaCPAN/Client/Request.pm | |
index ddd733a..3c58fcf 100644 | |
--- a/lib/MetaCPAN/Client/Request.pm | |
+++ b/lib/MetaCPAN/Client/Request.pm | |
@@ -89,15 +89,22 @@ sub ssearch { | |
( $self->_has_user_ua ? ( handle => $self->_user_ua ) : () ) | |
); | |
- my $scroller = Search::Elasticsearch::Scroll->new( | |
+ my %scroll_args = ( | |
es => $es, | |
search_type => 'scan', | |
scroll => '5m', | |
index => $self->version, | |
type => $type, | |
size => 1000, | |
- body => $self->_build_body($args), | |
- %{ $params }, | |
+ ); | |
+ | |
+ if ( ref $args eq 'HASH' and keys %{$args} ) { | |
+ $scroll_args{body} = $self->_build_body($args); | |
+ } | |
+ | |
+ my $scroller = Search::Elasticsearch::Scroll->new( | |
+ %scroll_args, | |
+ %{$params}, | |
); | |
return $scroller; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment