Skip to content

Commit

Permalink
Elasticsearch --> Search::Elasticsearch
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeyn committed Apr 3, 2014
1 parent 27cf92e commit efa9e93
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions lib/MetaCPAN/Client/Request.pm
Expand Up @@ -6,8 +6,8 @@ package MetaCPAN::Client::Request;
use Moo;
use Carp;
use JSON;
use Elasticsearch;
use Elasticsearch::Scroll;
use Search::Elasticsearch;
use Search::Elasticsearch::Scroll;
use Try::Tiny;
use HTTP::Tiny;

Expand Down Expand Up @@ -68,13 +68,13 @@ sub ssearch {
my $args = shift;
my $params = shift;

my $es = Elasticsearch->new(
my $es = Search::Elasticsearch->new(
nodes => $self->domain,
cxn_pool => 'Static::NoPing',
send_get_body_as => 'POST',
);

my $scroller = Elasticsearch::Scroll->new(
my $scroller = Search::Elasticsearch::Scroll->new(
es => $es,
search_type => 'scan',
scroll => '5m',
Expand Down Expand Up @@ -254,6 +254,6 @@ Fetches a path from MetaCPAN (post or get), and returns the decoded result.
=head2 ssearch
Calls an Elastic Search query (using L<Elasticsearch> and returns an
L<Elasticsearch::Scroll> scroller object.
Calls an Elastic Search query (using L<Search::Elasticsearch> and returns an
L<Search::Elasticsearch::Scroll> scroller object.
6 changes: 3 additions & 3 deletions lib/MetaCPAN/Client/ResultSet.pm
Expand Up @@ -9,8 +9,8 @@ use Carp;
has scroller => (
is => 'ro',
isa => sub {
ref $_[0] eq 'Elasticsearch::Scroll'
or croak 'scroller must be an Elasticsearch::Scroll object';
ref $_[0] eq 'Search::Elasticsearch::Scroll'
or croak 'scroller must be an Search::Elasticsearch::Scroll object';
},
handles => ['total'],
required => 1,
Expand Down Expand Up @@ -65,7 +65,7 @@ and facets.
=head2 scroller
An L<Elasticsearch::Scroll> object
An L<Search::Elasticsearch::Scroll> object
=head2 type
Expand Down
2 changes: 1 addition & 1 deletion t/api/favorite.t
Expand Up @@ -15,6 +15,6 @@ foreach my $option ( { author => 'XSAWYERX' }, { dist => 'MetaCPAN-Client' } ) {
isa_ok( $rs, 'MetaCPAN::Client::ResultSet' );
can_ok( $rs, qw<type scroller> );
is( $rs->type, 'favorite', 'Correct resultset type' );
isa_ok( $rs->scroller, 'Elasticsearch::Scroll' );
isa_ok( $rs->scroller, 'Search::Elasticsearch::Scroll' );
}

4 changes: 2 additions & 2 deletions t/resultset.t
Expand Up @@ -11,7 +11,7 @@ like(
exception {
MetaCPAN::Client::ResultSet->new(
type => 'failZZ',
scroller => bless {}, 'Elasticsearch::Scroll',
scroller => bless {}, 'Search::Elasticsearch::Scroll',
)
},
qr/Invalid type/,
Expand All @@ -20,7 +20,7 @@ like(

my $rs = MetaCPAN::Client::ResultSet->new(
type => 'author',
scroller => bless {}, 'Elasticsearch::Scroll',
scroller => bless {}, 'Search::Elasticsearch::Scroll',
);

isa_ok( $rs, 'MetaCPAN::Client::ResultSet' );
Expand Down

0 comments on commit efa9e93

Please sign in to comment.