SWISH::Prog::Native::Indexer - wrapper around Swish-e binary
use SWISH::Prog::Native::Indexer; my $indexer = SWISH::Prog::Native::Indexer->new( invindex => SWISH::Prog::Native::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;
The Native Indexer is a wrapper around the swish-e version 2.x binary tool.
Create indexer object. All the following parameters are also accessor methods.
A SWISH::Prog::InvIndex::Native object.
A SWISH::Prog::Config object.
The path to the swish-e executable. If empty, will just look in $ENV{PATH}.
swish-e
Takes same args as swish-e -v option.
swish-e -v
Takes same args as swish-e -W option.
swish-e -W
Initialize object. Called by new().
Returns true if the exe() executable works, false otherwise.
Start the indexer on its merry way. Stores the filehandle in fh().
Returns the $indexer object.
You likely don't want to pass cmd in but let start() construct it for you.
Get or set the open() filehandle for the swish-e process. CAUTION: don't set unless you know what you're doing.
You can print() to the filehandle using the SWISH::Prog index() method. Or do it directly like:
print { $indexer->fh } "your headers and body here";
The filehandle is close()'d by the finish() method.
Close the open fh() filehandle and check for any errors.
Called by the magic DESTROY method so $indexer will finish() whenever it goes out of scope.
merge() will merge @SWISH::Prog::Index::Native objects together with the index named in the calling object.
Returns the $indexer object on success, 0 on failure.
# TODO fix this
process() will parse and index $doc. $doc should be a SWISH::Prog::Doc instance.
Will croak() on failure.
Add doc to the index.
# TODO fix
Peter Karman, <perl@peknet.com>
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.
To install SWISH::Prog, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SWISH::Prog
CPAN shell
perl -MCPAN -e shell install SWISH::Prog
For more information on module installation, please visit the detailed CPAN module installation guide.