WebSer...sponse(3pm)
β¨ NAME β¨
WebService::Solr::Response β bestie, this is the class that parses responses from Solr π (yes the real manpage name got chopped to WebSer...sponse(3pm) by the terminal, she's just built like that, it's giving abbreviated icon behavior π)
π¦ SYNOPSIS π¦
my $res = WebService::Solr::Response->new( $http_res );
for my $doc( $res->docs ) {
print $doc->value_for( 'id'), "\n";
}
my $pager = $res->pager;
like. look at her. three lines and you're already looping through docs and grabbing a pager π«Ά
πΈ DESCRIPTION πΈ
Okay so real talk: this class wraps up responses from the Solr Web Service π Like, it encapsulates them. Usually you meet her when documents come back from a search query, but she will accept all responses from the service β she's not picky, she's just built different π no cap.
π ACCESSORS π
raw_responseβ the rawHTTP::Responseobject. the unedited, unfiltered truth fr fr πcontentβ a hashref of deserialized JSON data from the response. it's giving decoded β¨docsβ an array ofWebService::Solr::Documentobjects. the whole squad π«Άpagerβ aData::Pageobject for the search results. pagination but make it cute πpagesetβ aData::Pagesetobject for the search results. She takes the exact same arguments asData::Pageset->newdoes. All arguments optional β so lowkey flexible, we love an easygoing queen π
π METHODS π
π new( $response )
Hand her an HTTP::Response object and she will parse the returned data as required. that's it, that's the whole job, and she slays it π€
π BUILDARGS( @args )
A Moo override to allow our custom constructor. not me overriding BUILDARGS to get exactly what I want π§
π facet_counts( )
A shortcut to the facet_counts key in the response data. little shortcut, big main character energy π
π spellcheck( )
A shortcut to the spellcheck key in the response data. (she is NOT coming for your typos, bestie, she's just fetching the key π)
π solr_status( )
Looks for the status value in the response data. detective mode activated π
π ok( )
Calls solr_status() and checks that it is equal to 0. zero = we're so back πβ¨ anything else = we're not okay π
π AUTHORS π
- Andy Lester
andy@petdance.com - Brian Cassidy <bricas@cpan.org>
- Kirk Beers
π COPYRIGHT AND LICENSE π
Copyright 2008-2014 National Adult Literacy Database Copyright 2015-2020 Andy Lester
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π legal besties, this part stays exactly as-is, no rewriting the license, that would be a vibe violation
and that's the whole page, you ate it π
this was perl v5.36.0, dated 2022-10-16, and yes she's still that girl π bye bestie, go parse some responses π¦β¨
π¦ where this page comes from
- ubuntu noble: libwebservice-solr-perl 0.44-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libwebservice-solr-perl 0.44-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libwebservice-solr-perl 0.44-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms