The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

SYNOPSIS

    # Index @ $url
    $index = WebService::Lucene::Index->new( $url );
    
    # Get most recently modified documents
    $results = $index->list;
    
    # Search the index
    $results = $index->search( 'foo' );
    
    # Get a document
    $doc = $index->get_document( $id );
    
    # Create a document
    $doc = $index->create_document( $doc );
    
    # Delete the index
    $index->delete;

DESCRIPTION

The module represents a Lucene Index.

METHODS

new( $url )

Create a new Index object located at $url. Note, this will not actually create the index -- see create to do that.

base_url( [$url] )

Accessor for the index's url.

name( [$name] )

Accessor for the index's name.

properties( [$properties] )

Accessor for the index's properties.

_fetch_index_properties( )

Fetches the index.properties entry and sends the contents to _parse_index_properties.

_parse_index_properties( $xml )

Parses the XOXO document and sets the properties accessor.

delete( )

Deletes the current index.

update( )

Updates the index.properties file with the current set of properties.

facets( $facets, [$params] )

Give a facet (or set of facets as an array reference), it will return a WebService::Lucene::Results object with their details. You can pass any number of parameters that will be serialized as query string arguments.

list( [$params] )

Returns a WebService::Lucene::Results object with a list of the recently updated documents.

optimize( )

Optimizes the index.

create( )

Sends a create query to the server for the given index.

add_document( $document )

Adds $document to the index.

get_document( $id )

Returns a WebService::Lucene::Document.

delete_document( $id )

Deletes a document from the index

_properties_as_entry( )

Constructs an XML::Atom::Entry object representing the index's properties.

opensearch_client( )

returns an WWW::OpenSearch object for the index.

search( $query, [$params] )

Searches the index for $query. Pass any additional parameters as a hashref.

exists( )

True if the index exists on the server, otherwise false is returned.

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.