DBIx-Class-Indexer-WebService-Solr
view release on metacpan or search on metacpan
lib/DBIx/Class/Indexer/WebService/Solr.pm view on Meta::CPAN
186187188189190191192193194195196197198199200201202203204205
my
$object
=
shift
;
$self
->update_or_create_document(
$object
);
}
=head2 update( $object )
Calls C<update_or_create_document>.
=cut
sub
update {
my
$self
=
shift
;
my
$object
=
shift
;
$self
->update_or_create_document(
$object
);
}
=head2 delete( $object )
Deletes document from the index.
lib/DBIx/Class/Indexer/WebService/Solr.pm view on Meta::CPAN
216217218219220221222223224225226227228229230231232233234235
$solr
->delete_by_id(
$id
);
}
=head2 update_or_create_document( $object )
Will either update or add a document to the index.
=cut
sub
update_or_create_document {
my
$self
=
shift
;
my
$object
=
shift
;
my
$solr
=
$self
->_obj;
$self
->setup_fields(
ref
$object
);
# add == update
$solr
->add(
$self
->as_document(
$object
) );
}
( run in 0.392 second using v1.01-cache-2.11-cpan-c6e0e5ac2a7 )