NAME

OurNet::FuzzyIndex::Multifields - Multifield indexing extension to OurNet::FuzzyIndex

SYNOPSIS

 use OurNet::FuzzyIndex::Multifields;

 # Initiate indexer
 my $inx = OurNet::FuzzyIndex::Multifields->new(
					       inxdir => './index',
					       fields => [qw(title fulltext)],
					       weight => [qw(3 1)],
					       subdbs => 3,
					      );
 # Insert document
 $inx->insert(
	     0, # document key
	     title => 'This is the title',
	     fulltext => 'This is the full text',
	    );

 # Parse the content with different weights
 %words = $inx->parse_xs('This is another title', 5);
 $inx->insert(
	     1,
	     title => \%words,
	     fulltext => 'This is another page',
	    );
# Perform a query
%result = $inx->query(
   'search for some text in title',
   [qw(title)], # search title only
   $MATCH_FUZZY,
   );

# Perform another query
%result = $inx->query(
   'search for some text',
   '*',  # for all fields too
 );

DESCRIPTION

OurNet::FuzzyIndex::Multifields adds extended features to OurNet::FuzzyIndex by indexing multifield documents. The basic usage is much like that of OurNet::FuzzyIndex. Please refer to it.

A simple linear combination of multifields' scores is used as the scoring function of query result.

SEE ALSO

OurNet::FuzzyIndex

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Yung-chung Lin (a.k.a. xern) <xern@cpan.org>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself