NAME
SWISH::Prog::Indexer - base indexer class
SYNOPSIS
use SWISH::Prog::Indexer;
my $indexer = SWISH::Prog::Indexer->new(
invindex => SWISH::Prog::InvIndex->new,
config => SWISH::Prog::Config->new,
count => 0,
clobber => 1,
flush => 10000,
started => time()
);
$indexer->start;
for my $doc (@list_of_docs) {
$indexer->process($doc);
}
$indexer->finish;
DESCRIPTION
SWISH::Prog::Indexer is a base class implementing the simplest of indexing APIs. It is intended to be subclassed, along with InvIndex, for each IR backend library.
METHODS
new( params )
Constructor. See the SYNOPSIS for default options.
start
Opens the invindex() objet and sets the started() time to time().
process( doc )
doc should be a SWISH::Prog::Doc-derived object.
process() should implement whatever the particular IR library API requires.
finish
Closes the invindex().
AUTHOR
Peter Karman, <perl@peknet.com>
COPYRIGHT AND LICENSE
Copyright 2008 by Peter Karman
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.