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::Document - A document object

Accessors

       •   fields - an array of fields

       •   boost - a floating-point "boost" value

Authors

       Andy Lester "andy@petdance.com"

       Brian Cassidy <bricas@cpan.org>

       Kirk Beers

Description

       This class represents a basic document object, which is basically a collection of fields.

Methods

new(@fields|\@fields)
       Constructs  a  new  document  object given @fields. A field can be a WebService::Solr::Field object, or a
       structure accepted by "WebService::Solr::Field->new".

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

   add_fields(@fields|\@fields)
       Adds @fields to the document.

   field_names
       Returns a list of field names that are in this document.

   value_for($name)
       Returns the first value for $name.

   values_for($name)
       Returns all values for $name.

   to_element()
       Serializes the object to an XML::Easy::Element object.

   to_xml()
       Serializes the object to xml.

Name

       WebService::Solr::Document - A document object

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' );

See Also