++ed by:
EMAZEP

1 PAUSE user

Peter Karman
and 1 contributors

NAME

Dezi::App - build Dezi search applications

SYNOPSIS

 my $app = Dezi::App->new(
   invindex   => 't/testindex',
   aggregator => 'fs',
   indexer    => 'lucy',
   config     => 't/test.conf',
   filter     => sub { diag( "doc filter on " . $_[0]->url ) },
 );

 my $count = $app->run('path/to/files');

 printf("Indexed %d documents\n", $count);

DESCRIPTION

Dezi::App is convenience class for building search applications. It provides shortcuts for pulling together all the Dezi::App components into a single App object.

Dezi::App depends upon:

METHODS

The following attributes are available as params to new() and instance methods:

aggregator

Expects a Dezi::Aggregator instance or a shortcut string. The shortcuts are:

fs

Filesystem -- see Dezi::Aggregator::FS.

spider

Web crawler -- see Dezi::Aggregator::Spider.

mail

Mail::Box reader -- see Dezi::Aggregator::Mail.

mailfs

Mail::Box + filesystem -- see Dezi::Aggregator::MailFS.

aggregator_opts

Hashref passed to aggregator->new.

config

String or Path::Class::File object pointing at config file, or a Dezi::Indexer::Config object.

indexer

Shortcut string or Dezi::Indexer instance. Shortcuts include:

lucy

Dezi::Lucy::Indexer

dbi

TODO

xapian

TODO

test

Dezi::Test::Indexer

indexer_opts

Hashref passed directly to indexer->new.

invindex

String or Path::Class::Dir pointing at index directory, or a Dezi::InvIndex instance.

filter

A CODE reference, or a string or Path::Class::File object pointing at a file containing a CODE reference that can be loaded with do().

test_mode

Boolean turning off the indexer, running only the aggregator. Default is false (off).

BUILD

Internal method called by new(). Initializes the App object.

run( paths )

Run the app on paths. paths may be URLs, filesystem paths, or whatever the Aggregator expects.

Returns the Indexer count.

count

Returns the indexer's count. NOTE This is the number of documents actually indexed, not counting the number of documents considered and discarded by the aggregator. If you want the number of documents the aggregator looked at, regardless of whether they were indexed, use the aggregator's count() method.

AUTHOR

Peter Karman, <karpet@dezi.org>

BUGS

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

SUPPORT

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

    perldoc Dezi::App

You can also look for information at:

COPYRIGHT AND LICENSE

Copyright 2018 by Peter Karman

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

http://dezi.org/, http://swish-e.org/, http://lucy.apache.org/