Dear Perl Monks,
I am tring to use the module Search:VectorSpace to search for documents containing my query terms. But I'm not able to implement it.
http://www.perl.com/pub/2003/02/19/engine.html
use Search::VectorSpace;
my @docs = ...;
my $engine = Search::VectorSpace->new( docs =>\@docs, threshol
+d => .04);
$engine->build_index();
while ( my $query = <> ) {
my %results = $engine->search( $query );
print join "\n", keys %results;
}
As mentioned in the module description above, I just need to place my document list in the @docs array. But on doing so, the search is happening only on the document names, but not the content.
This is how I did it, is it right?
$dr="C:\\Users\\Desktop\\collection2";
opendir(DR, "$dr") || die "$!" ;
@docs=<DR>;
@docs=readdir DR;
I want it to search inside the document, not the document names.