11 Aug 2011 02:55:56 UTC
- Distribution: Lucy
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (3 / 16 / 0)
- KwaliteeBus factor: 1
- License: apache_2_0
- Perl: v5.8.3
- Activity24 month
- Download (1.02MB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:6 non-PAUSE usersCREAMYG Marvin Humphreyand 1 contributors
- The Apache Lucy Project <lucy-dev at incubator dot apache dot org>
Lucy::Index::IndexManager - Policies governing index updating, locking, and file deletion.
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 );
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.
my $manager = Lucy::Index::IndexManager->new( host => $hostname, # default: "" );
host - An identifier which should be unique per-machine.
lock_factory - A LockFactory.
Create the Lock which controls access to modifying the logical content of the index.
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.
reader - A PolyReader.
del_writer - A DeletionsWriter.
cutoff - A segment number which all returned SegReaders must exceed.
optimize - A boolean indicating whether to spend extra time optimizing the index for search-time performance.
foldermember. Typical clients (Indexer, IndexReader) will use this method to install their own Folder instance.
Setter for write lock timeout. Default: 1000 milliseconds.
Getter for write lock timeout.
Setter for write lock retry interval. Default: 100 milliseconds.
Getter for write lock retry interval.
Lucy::Index::IndexManager isa Lucy::Object::Obj.