WebSer...cument(3pm)

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

πŸ’– NAME πŸ’–

WebService::Solr::Document β€” it's a document object, bestie. That's the whole vibe. A little container, a glow-up for your fields. πŸ¦‹


✨ SYNOPSIS ✨

my $doc = WebService::Solr::Document->new;
$doc->add_fields( @fields );
$doc->boost( 2.0 );
my $id = $doc->value_for( 'id' );
my @subjects = $doc->values_for( 'subject' );

okay so literally five lines and you're already living your best life, no cap πŸ’…


🌸 DESCRIPTION 🌸

This class is a basic document object, and honestly? A document is basically just a collection of fields. That's it. That's the whole personality. A little group chat of fields, all vibing together in one object. πŸŽ€


πŸ‘‘ ACCESSORS πŸ‘‘

  • fields β€” an array of fields. the whole squad, assembled. 🫢
  • boost β€” a floating-point "boost" value. yes it's literally called boost. it's giving main character energy and we respect it. ✨

πŸ”₯ METHODS πŸ”₯

🧚 new( @fields|\@fields )

Constructs a new document object, and you hand it @fields. Each field can be a WebService::Solr::Field object, OR a structure that "WebService::Solr::Field->new" would accept. so like, you got options, bestie. flexible queen behavior. πŸ’œ

πŸ’« BUILDARGS( @args )

A Moose override β€” it exists purely so we can do our custom constructor thing. that's it, that's the job. lowkey iconic of it. 😭

🌈 add_fields( @fields|\@fields )

Adds @fields to the document. boom. more fields. obsessed. πŸ’–

⭐ field_names

Returns a list of field names that are in this document. like a guest list, but for fields. πŸ“‹βœ¨

πŸ“ value_for( $name )

Returns the first value for $name. just the first one. not all of them. patience, babe. πŸ™ˆ

πŸ¦‹ values_for( $name )

Returns all the values for $name. the full haul. every single one. slay. πŸ’…

πŸŽ€ to_element( )

Serializes the object to an XML::Easy::Element object. yeah, it's XML time. glow-up to markup. πŸ”₯

πŸ’€ to_xml( )

Serializes the object to xml. that's it. that's the tweet. fr fr. ✨


🫢 AUTHORS 🫢

  • Andy Lester "andy@petdance.com"
  • Brian Cassidy <bricas@cpan.org>
  • Kirk Beers

the founding mothers/fathers of this whole situation. we thank them. πŸ™πŸ’–


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.

πŸ’Œ so yes, it's free software, same terms as Perl itself β€” go forth and remix responsibly, bestie.

and that's the whole page!! 🌈 this was WebSer...cument(3pm) from the User Contributed Perl Documentation, running on perl v5.36.0, dated 2022-10-16. mwah, bye!! πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from