Search::Indexer::Incremental::MD5::Searcher - Search your indexed files
my $search_string = 'find_me' ; my $searcher = eval { Search::Indexer::Incremental::MD5::Searcher->new ( USE_POSITIONS => 1, INDEX_DIRECTORY => 'text_index', get_perl_word_regex_and_stop_words(), ) } or croak "No full text index found! $@\n" ; my $results = $searcher->search($search_string) ; # sort in decreasing score order my @indexes = map { $_->[0] } reverse sort { $a->[1] <=> $b->[1] } map { [$_, $results->[$_]{SCORE}] } 0 .. $#$results ; for (@indexes) { print {* STDOUT} "$results->[$_]{PATH} [$results->[$_]{SCORE}].\n" ; } $searcher = undef ;
This module implements an incremental text indexer and searcher based on Search::Indexer.
Given a list of files, this module will allow you to create an indexed text database that you can later query for matches. You can also use the siim command line application installed with this module.
Create a Search::Indexer::Incremental::MD5::Searcher object.
my $indexer = new Search::Indexer::Incremental::MD5::Searcher(%named_arguments) ;
Arguments - %named_arguments
Returns - A Search::Indexer::Incremental::MD5::Searcher object
Exceptions -
Incomplete argument list
Error creating index directory
Error opening index metadata database
Error creating a Search::Indexer object
Returns an array reference containing words starting with $prefix
Arguments
$prefix - String - only words starting with $prefix will be returned
Returns - An array reference containing the words starting with $prefix
Exceptions - No full text index found
search for $search_string in the index database
Arguments %named_arguments
Returns - Array reference - each entry contains
SCORE - the score obtained by the file when applying the query
PATH - the path to the file
MD5 - the file MD5 when the indexing was done
search for documents which description matches a regular expression passed as argument. Documents without description never match.
DESCRIPTION - the file description
None so far.
Nadim ibn hamouda el Khemir CPAN ID: NKH mailto: nadim@cpan.org
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
You can find documentation for this module with the perldoc command.
perldoc Search::Indexer::Incremental::MD5
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Search-Indexer-Incremental-MD5
RT: CPAN's request tracker
Please report any bugs or feature requests to L <bug-search-indexer-incremental-md5@rt.cpan.org>.
We will be notified, and then you'll automatically be notified of progress on your bug as we make changes.
Search CPAN
http://search.cpan.org/dist/Search-Indexer-Incremental-MD5
To install Search::Indexer::Incremental::MD5, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Search::Indexer::Incremental::MD5
CPAN shell
perl -MCPAN -e shell install Search::Indexer::Incremental::MD5
For more information on module installation, please visit the detailed CPAN module installation guide.