NAME
Class::Indexed : An abstract class providing fine-grained and incremental update fulltext indexing for classes
SYNOPSIS
use Class::Indexed;
our @ISA = qw(Class::Indexed);
# build the index and metadata tables Class::Indexed->build_index_tables(database=>$db,host=>$host,username=>$user,password=>$password);
# set which attributes / fields are to be indexed and their weighting, etc $self->indexed_fields ( dbh=>$dbh, key=>'Pub_ID', fields=>[ { name=>'Pub_Name', weight=>1 }, ], );
# index an object $self->index_object();
# index a field or attribute of an object $self->index_field($self->{Pub_ID}, $field, $value);
# remove the object from the metadata and index tables $self->delete_location();
# add the object to the metadata table $self->add_location();
DESCRIPTION
This abstract class provides inherited indexing functionality to any class using it as a superclass.
Class::Indexed is designed to provide most of the functionality described in the article : 'Adding Search Functionality to Perl Applications' ( http://www.perl.com/pub/a/2003/09/25/searching.html ) and I recommend you read it through to gain understanding of the code and principles involved.
see the examples for the best explaination of how to use this class
EXPORT
None by default.
METHODS
build_index_tables
builds the index and metadata tables, you need to run this before you can use the indexing
my $success = Class::Indexed->build_index_tables(database=>$db,host=>$host,username=>$user,password=>$password);
index_object
indexes the object, updates the metadata if required
$self->index_object();
before you can call index_object you must set the fields to be indexed with the indexed_fields method
index_field
indexes a particular field or attribute of the object
$self->index_field($fieldname,$value)
takes the name of the attribute/field and the new value
before you can call index_field you must set the fields to be indexed with the indexed_fields method
delete_location
remove the object from the metadata and index tables
$self->delete_location();
add_location
add the object to the metadata table
$self->add_location();
indexed_fields
set which attributes / fields are to be indexed and their weighting, etc $self->indexed_fields ( dbh=>$dbh, key=>'Pub_ID', fields=>[ { name=>'Pub_Name', weight=>1 }, ], );
AUTHOR
Aaron J. Trevena, <aaron.trevena@droogs.org>
SEE ALSO
perl.