logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

WebService::Solr::Response - Parse responses from Solr

Accessors

       •   raw_response - the raw HTTP::Response object.

       •   content - a hashref of deserialized JSON data from the response.

       •   docs - an array of WebService::Solr::Document objects.

       •   pager - a Data::Page object for the search results.

       •   pageset   -   a   Data::Pageset   object  for  the  search  results.  Takes  the  same  arguments  as
           "Data::Pageset->new" does. All arguments optional.

Authors

       Andy Lester "andy@petdance.com"

       Brian Cassidy <bricas@cpan.org>

       Kirk Beers

Description

       This class encapsulates responses from the Solr Web Service. Typically it is used when documents are
       returned from a search query, though it will accept all responses from the service.

Methods

new($response)
       Given an HTTP::Response object, it will parse the returned data as required.

   BUILDARGS(@args)
       A Moo override to allow our custom constructor.

   facet_counts()
       A shortcut to the "facet_counts" key in the response data.

   spellcheck()
       A shortcut to the "spellcheck" key in the response data.

   solr_status()
       Looks for the status value in the response data.

   ok()
       Calls "solr_status()" and check that it is equal to 0.

Name

       WebService::Solr::Response - Parse responses from Solr

Synopsis

           my $res = WebService::Solr::Response->new( $http_res );
           for my $doc( $res->docs ) {
               print $doc->value_for( 'id'), "\n";
           }
           my $pager = $res->pager;

See Also