
DBIx::Class::Indexer::WebService::Solr - Automatic indexing of DBIx::Class objects via WebService::Solr

package MySchema::Foo;
use base qw( DBIx::Class );
__PACKAGE__->load_components( qw( Indexed Core ) );
__PACKAGE__->table('foo');
__PACKAGE__->set_indexer('WebService::Solr');
__PACKAGE__->add_columns(
foo_id => { # automatically indexed as "id"
data_type => 'integer',
is_auto_increment => 1
},
name => {
data_type => 'varchar',
size => 10,
indexed => {
boost => '2.0',
}
},
location => {
data_type => 'varchar',
size => 50,
indexed => 1
}
);
__PACKAGE__->has_many( widgets => 'widget' );
__PACKAGE__->add_index_fields(
widget => {
source => 'widgets.name'
},
);

Connects a DBIx::Class-based class to a Solr index.

Creates a new WebSevice::Solr object and normalizes the fields to be indexed.
Normalizes the index fields so they all have hashref members with an optional boost key.
Uses the indexed fields information to determine how to get the values for $key out of $object.
Constructs a new WebService::Solr::Document object, populates it with data from $object, and returns it.
Calls update_or_create_document.
Calls update_or_create_document.
Deletes document from the index.
Will either update or add a document to the index.


Brian Cassidy <bricas@cpan.org>

Copyright 2008 by Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.