Search::Indexer::Incremental::MD5::Indexer - Incrementally index your files
use File::Find::Rule ; use Readonly ; Readonly my $DEFAUT_MAX_FILE_SIZE_INDEXING_THRESHOLD => 300 << 10 ; # 300KB my $indexer = Search::Indexer::Incremental::MD5::Indexer->new ( USE_POSITIONS => 1, INDEX_DIRECTORY => 'text_index', get_perl_word_regex_and_stop_words(), ) ; my @files = File::Find::Rule ->file() ->name( '*.pm', '*.pod' ) ->size( "<=$DEFAUT_MAX_FILE_SIZE_INDEXING_THRESHOLD" ) ->not_name(qr[auto | unicore | DateTime/TimeZone | DateTime/Locale]) ->in('.') ; indexer->add_files(@files) ; indexer->add_files(@more_files) ; indexer = 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::Indexer object.
my $indexer = new Search::Indexer::Incremental::MD5::Indexer(%named_arguments) ;
Arguments - %named_arguments
Returns - A Search::Indexer::Incremental::MD5::Indexer object
Exceptions -
Incomplete argument list
Error creating index directory
Error creating index metadata database
Error creating a Search::Indexer object
Adds the contents of the files passed as arguments to the index database. Files already indexed are checked and re-indexed only if their content has changed
Arguments %named_arguments
STATE - Boolean -
ID - integer - document id
TIME - Float - re_indexing time
Returns - Hash reference keyed on the file name
TIME - Float - re-indexing time
Exceptions
Arguments
Returns - Hash reference containing
removes the contents of the files passed as arguments from the index database.
TIME - Float - removal time
removes the contents of the files passed as arguments
$id - The id of the document to remove from the database
$content - The contents of the document or undef
Returns - Nothing
Exceptions - None
Checks the index database contents.
TIME - Float - check time
Returns - Hash reference keyed on the file name or nothing in void context
Checks the index database contents and remove any reference to documents that don't exist.
Arguments - None
Returns - Array reference containing the named of the document that don't exist
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.