WebSer...sponse(3pm)

πŸ“¦
version 0.44 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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 raw HTTP::Response object. the unedited, unfiltered truth fr fr πŸ’€
  • content β€” a hashref of deserialized JSON data from the response. it's giving decoded ✨
  • docs β€” an array of WebService::Solr::Document objects. the whole squad 🫢
  • pager β€” a Data::Page object for the search results. pagination but make it cute πŸ“„
  • pageset β€” a Data::Pageset object for the search results. She takes the exact same arguments as Data::Pageset->new does. 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 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