The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

SWISH::Prog::Indexer::Native - wrapper around Swish-e binary

new

Create indexer object. All the following parameters are also accessor methods.

index

A SWISH::Prog::InvIndex::Native object.

config

A SWISH::Prog::Config object.

exe

The path to the swish-e executable. If empty, will just look in $ENV{PATH}.

verbose

Takes same args as swish-e -v option.

warnings

Takes same args as swish-e -W option.

init

Initialize object. Called by new().

swish_check

Returns true if the exe() executable works, false otherwise.

start( [cmd] )

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.

fh

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.

finish

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( @SWISH::Prog::Index::Native objects )

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( $doc )

process() will parse and index $doc. $doc should be a SWISH::Prog::Doc instance.

Will croak() on failure.

add( doc )

Add doc to the index.

 # TODO fix
 

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.