Apache-Solr

 view release on metacpan or  search on metacpan

lib/Apache/Solr.pod  view on Meta::CPAN

=encoding utf8

=head1 NAME

Apache::Solr - Apache Solr (Lucene) extension

=head1 INHERITANCE

 Apache::Solr is extended by
   Apache::Solr::JSON
   Apache::Solr::XML

=head1 SYNOPSIS

  # use Log::Report mode => "DEBUG";
  my $solr    = Apache::Solr->new(server => $url);
  my $lwp     = $solr->agent;   # internal LWP::UserAgent

  my $doc     = Apache::Solr::Document->new(...);
  my $results = $solr->addDocument($doc);
  $results or die $results->errors;

  my $results = $solr->select(q => 'author:mark');
  my $doc     = $results->selected(3);
  print $doc->_author;

  my $results = $solr->select(q => "really", hl => {fl=>'content'});
  while(my $doc = $results->nextSelected)
  {    my $hldoc = $results->highlighted($doc);
      print $hldoc->_content;
      ...
  }

  # based on Log::Report, hence (for communication errors and such)
  use Log::Report;
  dispatcher SYSLOG => 'default';  # now all warnings/error to syslog
  try { $solr->select(...) }; print $@->wasFatal;

  # [1.11] Information about communication errors 
  my $result = try { $solr->select(...) };
  if(my $ex = $@->wasFatal)
  {  $result = $ex->message->valueOf('result');
     if(defined $result)   #!! defined !!
     {    warn Dumper $result->decoded;

=head1 DESCRIPTION

Solr is a stand-alone full-text search-engine (based on Lucent), with
loads of features.  This module tries to provide a high level interface
to the Solr server.

See F<F<http://wiki.apache.org/solr/> and F<http://lucene.apache.org/solr/>

=head1 METHODS

=head2 Constructors

=over 4

=item Apache::Solr-E<gt>B<new>(%options)



( run in 3.766 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )