NAME

Dezi::Lucy::Searcher - Dezi Apache Lucy Searcher

SYNOPSIS

my $searcher = Dezi::Lucy::Searcher->new(
    invindex             => 'path/to/index',
    max_hits             => 1000,
    find_relevant_fields => 1,   # default: 0
    nfs_mode             => 1,   # default: 0
);

my $results = $searcher->search( 'foo bar' );
while (my $result = $results->next) {
    printf("%4d %s\n", $result->score, $result->uri);
}

DESCRIPTION

Dezi::Lucy::Searcher is an Apache Lucy based Searcher class for Dezi::App.

Dezi::Lucy::Searcher is not made to replace the more fully-featured Lucy::Search::Searcher class and its friends. Instead, Dezi::Lucy::Searcher provides a simple API similar to other Dezi::Searcher-based backends so that you can experiment with alternate storage engines without needing to change much code. When your search application requirements become more complex, the author recommends the switch to using Lucy::Search::Searcher directly.

CONSTANTS

All the SWISH::3 constants are imported into this namespace, including:

  • SWISH_DOC_PROP_MAP

METHODS

Only new and overridden methods are documented here. See the Dezi::Searcher documentation.

BUILD

Called internally by new(). Additional parameters include:

find_relevant_fields 1|0

Set to true to have the Results object locate the fields that matched the query. Default is 0 (off).

nfs_mode 1|0

Set to true if your index is stored on a NFS filesystem. Extra locking precautions are implemented when this mode is on (1). Default is off (0).

init_qp_config

Overrides base method to return a Search::Query::Parser config for the Lucy Dialect.

get_propnames

Returns array ref of PropertyNames defined for the invindex. The array will not contain any alias names or reserved PropertyNames.

search( query [, opts ] )

Returns a Dezi::Lucy::Results object.

query is assumed to be query string compatible with Search::Query::Dialect::Lucy.

See the Dezi::Searcher documentation for a description of opts. Note the following differences:

order

The order param in opts may be a Lucy::Search::SortSpec object.

default_boolop

The default Boolean connector for parsing query. Valid values are AND and OR. The default is AND (which is different than Lucy::QueryParser, but the same as Swish-e).

get_lucy

Returns the internal Lucy::Search::PolySearcher object.

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/