Logan Bell > Lucy > Lucy::Index::IndexManager

Download:
Lucy-0.3.2.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  3
Open  0
View/Report Bugs
Module Version: 0.003002   Source   Latest Release: Lucy-0.3.3

NAME ^

Lucy::Index::IndexManager - Policies governing index updating, locking, and file deletion.

SYNOPSIS ^

    use Sys::Hostname qw( hostname );
    my $hostname = hostname() or die "Can't get unique hostname";
    my $manager = Lucy::Index::IndexManager->new( 
        host => $hostname,
    );

    # Index time:
    my $indexer = Lucy::Index::Indexer->new(
        index => '/path/to/index',
        manager => $manager,
    );

    # Search time:
    my $reader = Lucy::Index::IndexReader->open(
        index   => '/path/to/index',
        manager => $manager,
    );
    my $searcher = Lucy::Search::IndexSearcher->new( index => $reader );

DESCRIPTION ^

IndexManager is an advanced-use class for controlling index locking, updating, merging, and deletion behaviors.

IndexManager and Architecture are complementary classes: Architecture is used to define traits and behaviors which cannot change for the life of an index; IndexManager is used for defining rules which may change from process to process.

CONSTRUCTORS ^

new( [labeled params] )

    my $manager = Lucy::Index::IndexManager->new(
        host => $hostname,    # default: ""
    );

METHODS ^

make_write_lock()

Create the Lock which controls access to modifying the logical content of the index.

recycle( [labeled params] )

Return an array of SegReaders representing segments that should be consolidated. Implementations must balance index-time churn against search-time degradation due to segment proliferation. The default implementation prefers small segments or segments with a high proportion of deletions.

set_folder(folder)

Setter for folder member. Typical clients (Indexer, IndexReader) will use this method to install their own Folder instance.

get_folder()

Getter for folder member.

get_host()

Getter for host member.

set_write_lock_timeout(timeout)

Setter for write lock timeout. Default: 1000 milliseconds.

get_write_lock_timeout()

Getter for write lock timeout.

set_write_lock_interval(timeout)

Setter for write lock retry interval. Default: 100 milliseconds.

get_write_lock_interval()

Getter for write lock retry interval.

INHERITANCE ^

Lucy::Index::IndexManager isa Lucy::Object::Obj.

syntax highlighting: