Catmandu::Store::Solr - A searchable store backed by Solr
Version 0.02
use Catmandu::Store::Solr; my $store = Catmandu::Store::Solr->new(url => 'http://localhost:8983/solr' ); my $obj1 = $store->bag->add({ name => 'Patrick' }); printf "obj1 stored as %s\n" , $obj1->{_id}; # Force an id in the store my $obj2 = $store->bag->add({ _id => 'test123' , name => 'Nicolas' }); # Commit all changes $store->bag->commit; my $obj3 = $store->bag->get('test123'); $store->bag->delete('test123'); $store->bag->delete_all; # All bags are iterators $store->bag->each(sub { ... }); $store->bag->take(10)->each(sub { ... }); # Some stores can be searched my $hits = $store->bag->search(query => 'name:Patrick');
Solr schemas need to support '_id' and '_bag' record fields to be able to store Catmandu items.
Create a new Catmandu::Store::Solr store.
Catmandu::Store
Patrick Hochstenbach, <patrick.hochstenbach at ugent.be> Nicolas Steenlant, <nicolas.steenlant at ugent.be>
<patrick.hochstenbach at ugent.be>
<nicolas.steenlant at ugent.be>
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Catmandu::Store::Solr, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu::Store::Solr
CPAN shell
perl -MCPAN -e shell install Catmandu::Store::Solr
For more information on module installation, please visit the detailed CPAN module installation guide.