Search::Indexer::Incremental::MD5::Searcher - Search your indexed files


Search-Indexer-Incremental-MD5 documentation  | view source Contained in the Search-Indexer-Incremental-MD5 distribution.

Index


NAME

Top

Search::Indexer::Incremental::MD5::Searcher - Search your indexed files

SYNOPSIS

Top

  


  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 ;




DESCRIPTION

Top

This module implements an incremental text indexer and searcher based on Search::Indexer.

DOCUMENTATION

Top

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.

SUBROUTINES/METHODS

Top

new( %named_arguments)

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

words( $prefix)

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(%named_arguments)

search for $search_string in the index database

Arguments %named_arguments

SEARCH_STRING - Query string see Search::Indexer

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

match_description(%named_arguments)

search for documents which description matches a regular expression passed as argument. Documents without description never match.

Arguments %named_arguments

SEARCH_STRING - regular expression to match with the description field

Returns - Array reference - each entry contains

* PATH - the path to the file
* MD5 - the file MD5 when the indexing was done
* DESCRIPTION - the file description

BUGS AND LIMITATIONS

Top

None so far.

AUTHOR

Top

	Nadim ibn hamouda el Khemir
	CPAN ID: NKH
	mailto: nadim@cpan.org

LICENSE AND COPYRIGHT

Top

SUPPORT

Top

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

SEE ALSO

Top


Search-Indexer-Incremental-MD5 documentation  | view source Contained in the Search-Indexer-Incremental-MD5 distribution.