NAME

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

SYNOPSIS

my $doc = Apache::Solr::Document->new(...);

METHODS

Constructors

Apache::Solr::Document->new(OPTIONS)
-Option--Default
 boost   1.0
 fields  {}
boost => FLOAT

Boost the preference for hits in this document.

fields => HASH|ARRAY

Passed to addFields().

Accessors

$obj->addField(NAME, CONTENT, OPTIONS)

CONTENT can be specified as SCALAR (reference) for performance. In that case, a reference to the original will be kept. When undef, the field gets ignored.

-Option--Default
 boost   1.0
boost => FLOAT
$obj->addFields(HASH|ARRAY, OPTIONS)

The HASH or ARRAY containing NAME/CONTENT pairs. The OPTIONS are passed addField() as OPTIONS.

$obj->boost()

Boost value for all fields in the document.

$obj->field(NAME)

Returns the first field with NAME (or undef). This is a HASH.

$obj->fieldNames()

All used unique names.

$obj->fields([NAME])

Returns a list of HASHs, each containing at least a name and a content. Each HASH will also contain a boost value. When a NAME is provided, only those fields are returned.

Helpers

SEE ALSO

This module is part of Apache-Solr distribution version 0.90, built on December 03, 2012. Website: http://perl.overmeer.net

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 http://www.perl.com/perl/misc/Artistic.html