SWISH::Prog::Indexer - base indexer class


SWISH-Prog documentation  | view source Contained in the SWISH-Prog distribution.

Index


NAME

Top

SWISH::Prog::Indexer - base indexer class

SYNOPSIS

Top

 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

Top

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

Top

new( params )

Constructor. See the SYNOPSIS for default options.

params may include the following keys, each of which is also an accessor method:

clobber

Overrite any existing InvIndex.

config

A SWISH::Prog::Config object or file name.

flush

The number of indexed docs at which in-memory changes should be written to disk.

invindex

A SWISH::Prog::InvIndex object.

test_mode

Dry run mode, just prints info on stderr but does not build index.

init

Override base method to initialize object.

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().

count

Returns the number of documents processed.

started

The time at which the Indexer object was created. Returns a Unix epoch integer.

AUTHOR

Top

Peter Karman, <perl@peknet.com>

BUGS

Top

Please report any bugs or feature requests to bug-swish-prog at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SWISH-Prog. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc SWISH::Prog




You can also look for information at:

* Mailing list

http://lists.swish-e.org/listinfo/users

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=SWISH-Prog

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/SWISH-Prog

* CPAN Ratings

http://cpanratings.perl.org/d/SWISH-Prog

* Search CPAN

http://search.cpan.org/dist/SWISH-Prog/

COPYRIGHT AND LICENSE

Top

SEE ALSO

Top

http://swish-e.org/


SWISH-Prog documentation  | view source Contained in the SWISH-Prog distribution.