NAME

WebService::Lucene::Document - Object to represent a Lucene Document

SYNOPSIS

# Create a new document
$doc = WebService::Lucene::Document->new;

# add a field
$doc->add( $field );

DESCRIPTION

Object to represent a Lucene Document.

METHODS

new( )

Creates an empty document.

create()

Sends a create request for this document.

new_from_entry( $entry )

Takes an XML::Atom::Entry and constructs a new object.

add( @fields )

Adds each field to the document.

add_keyword( $name => $value )

Auto-generated shortcuts to add a "keyword" field.

add_sorted $name => $value )

Auto-generated shortcuts to add a "sorted" field.

add_text( $name => $value )

Auto-generated shortcuts to add a "keyword" field.

add_unindexed( $name => $value )

Auto-generated shortcuts to add a "keyword" field.

add_unstored( $name => $value )

Auto-generated shortcuts to add a "keyword" field.

title( [$title] )

The title of the document, set from search or listing results.

relevance( [$relevance] )

A floating point number (0..1) set from search results.

fields_ref( [$fields] )

A name-keyed hashref of field objects.

facets()

Technically an alias for fields. But should only be used when fetching facet results.

get( [$name] )

Alias for fields.

fields( [$name] )

Returns all fields named <$name> or all fields if no name is specified.

clear_fields( )

Removes all fields from this document

remove_field( $field )

Remove a particular field from the document

as_entry( )

Generates an XML::Atom::Entry object for the current document.

update( )

Updates the document in the index.

delete( )

Delete the document from the index.

_field_accessor( $name )

Generates a closure for accessing a field.

AUTHORS

  • Brian Cassidy <brian.cassidy@nald.ca>

  • Adam Paynter <adam.paynter@nald.ca>

COPYRIGHT AND LICENSE

Copyright 2006-2009 National Adult Literacy Database

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.