Apache-Solr

 view release on metacpan or  search on metacpan

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

	my $ct  = delete $p{'content.type'};
	my $fn  = delete $p{file};
	$p{'resource.name'} ||= $fn if $fn && !ref $fn;

	$p{commit} = _to_bool $self->autocommit
		unless exists $p{commit};

	if(defined $p{string})
	{	# try to avoid copying the data, which can be huge
		$data = $ct =~ m!^text/!i
		  ? \encode(utf8 => (ref $p{string} eq 'SCALAR' ? ${$p{string}} : $p{string}))
		  : (ref $p{string} eq 'SCALAR' ? $p{string} : \$p{string} );

		delete $p{string};
	}
	elsif($fn)
	{	local $/;
		if(ref $fn eq 'GLOB') { $data = \<$fn> }
		else
		{	local *IN;
			open IN, '<:raw', $fn or fault __x"Cannot read document from {fn}", fn => $fn;

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

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

=encoding utf8

=head1 NAME

Apache::Solr::Document - Apache Solr (Lucene) Document container

=head1 SYNOPSIS

  # create and upload a new document
  my $doc = Apache::Solr::Document->new(...);
  $doc->addField(id => 'tic');

lib/Apache/Solr/JSON.pm  view on Meta::CPAN

use HTTP::Request        ();
use JSON                 ();
use Scalar::Util         qw(blessed);


sub init($)
{	my ($self, $args) = @_;
	$args->{format}   ||= 'JSON';
	$self->SUPER::init($args);

	$self->{ASJ_json} = $args->{json} || JSON->new->utf8;
	$self;
}

#---------------

sub json() {shift->{ASJ_json}}

#--------------------------

sub _select($$)

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

=encoding utf8

=head1 NAME

Apache::Solr::JSON - Apache Solr (Lucene) client via JSON

=head1 INHERITANCE

 Apache::Solr::JSON
   is an Apache::Solr

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

=item agent => LWP::UserAgent object

=item autocommit => BOOLEAN

=item core => NAME

=item format => 'XML'|'JSON'

=item json => JSON object

By default, an JSON object is created for you, in utf8 mode.

=item retry_max => COUNT

=item retry_wait => SECONDS

=item server => URL

=item server_version => VERSION

=back

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

=encoding utf8

=head1 NAME

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

=head1 SYNOPSIS

  # All operations return a ::Result object
  my $result = $solr->select(...);

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

=encoding utf8

=head1 NAME

Apache::Solr::XML - Apache Solr (Lucene) client via XML

=head1 INHERITANCE

 Apache::Solr::XML
   is an Apache::Solr



( run in 0.264 second using v1.01-cache-2.11-cpan-a5abf4f5562 )