=head1 NAME

Apache::Solr::Result - Apache Solr (Lucene) result container

=head1 SYNOPSIS

  my $result = $solr->select(...);
  my $result = $solr->queryTerm(...);
  $result or die $result->error;  # $result is object but false

=head1 METHODS

=head2 Constructors

=over 4

=item Apache::Solr::Result-E<gt>B<new>(OPTIONS)

 -Option  --Default
  endpoint  <required>
  params    <required>
  request   undef
  response  undef

=over 2

=item endpoint => URI

=item params => ARRAY

=item request => HTTP::Request object

=item response => HTTP::Response object

=back

=back

=head2 Accessors

=over 4

=item $obj-E<gt>B<decoded>([HASH])

=item $obj-E<gt>B<elapse>()

Number of seconds used to receive a decoded answer.

=item $obj-E<gt>B<endpoint>()

The URI where the request is sent to.

=item $obj-E<gt>B<params>()

List of (expanded) parameters used to call the solr server.

=item $obj-E<gt>B<request>([REQUEST])

=item $obj-E<gt>B<response>([RESPONSE])

=item $obj-E<gt>B<solrError>()

=item $obj-E<gt>B<solrQTime>()

Elapse (as reported by the server) to handle the request.  In seconds!

=item $obj-E<gt>B<solrStatus>()

=item $obj-E<gt>B<start>()

The timestamp of the moment the call has started, including the creation of
the message to be sent.

=item $obj-E<gt>B<success>()

Returns true if the command has successfully completed.  

example: 

   my $result = $sorl->commit;
   $result->success or die;
   $result or die;          # same, via overloading
   $solr->commit or die;    # same, also overloading

=back

=head2 Response information

=over 4

=item $obj-E<gt>B<highlighted>(DOCUMENT)

Return information which relates to the selected DOCUMENT.

=item $obj-E<gt>B<nrSelected>()

Returns the number of selected documents, as result of a
L<Apache::Solr::select()|Apache::Solr/"Search"> call.  Probably many of those documents are
not loaded (yet).

=item $obj-E<gt>B<selected>(RANK [,CLIENT])

Returns information about the query by L<Apache::Solr::select()|Apache::Solr/"Search"> on
position RANK.  Returned is a HASH, which can have fields 'doc' and 'hl'
(maybe more later)

The first request will take a certain number of "rows".  If you pass
the CLIENT, this routine will automatically collect more of the
selected answers.

example: 

   my $r = $solr->select(rows => 10, ...);
   $r or die;

   if(my $last = $r->selected(9)) {...}

   my $elf = $r->selected(11);         # error
   my $elf = $r->selected(11, $solr);  # auto-collects more

=item $obj-E<gt>B<terms>(FIELD [, TERMS])

Returns the results of a 'terms' query (see L<Apache::Solr::queryTerms()|Apache::Solr/"Search">),
which is a HASH.

When TERMS are specified, a new table is set.

In Solr XML (at least upto v4.0) the results are presented as lst, not arr
So: their sort order is lost.

=back

=head2 Helpers

=over 4

=item $obj-E<gt>B<replaceParams>(HASH, OLDPARAMS)

=item $obj-E<gt>B<selectedPage>(PAGENR)

=item $obj-E<gt>B<selectedPageLoad>(RANK, CLIENT)

=item $obj-E<gt>B<selectedPageNr>(RANK)

=item $obj-E<gt>B<selectedPageSize>()

=item $obj-E<gt>B<selectedPages>()

=item $obj-E<gt>B<showTimings>([FILEHANDLE])

Print timing informat to the FILEHANDLE, by default the selected
file-handle (probably STDOUT).

=back

=head1 OVERLOADING

=over 4

=item overload: B<stringification>()

=back

=head1 SEE ALSO

This module is part of Apache-Solr distribution version 0.91,
built on December 04, 2012. Website: F<http://perl.overmeer.net>

=head1 LICENSE

Copyrights 2012 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See F<http://www.perl.com/perl/misc/Artistic.html>

