Catmandu-Solr

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for Catmandu-Solr

0.0304  2019-09-20 09:52:59 CEST
       - add missing dependency

0.0303  2017-10-03 16:55:18 CEST
       - support http keep-alive

0.0302  2017-04-20 15:36:51 CEST
       - fix typo
       - more pod

0.0301  2017-04-06 18:15:24 CEST
       - use Catmandu::Bag provided id/key/id_field

0.03  2017-03-23 14:31:04 CET
       - use new Catmandu::CQLSearchable role

lib/Catmandu/Store/Solr.pm  view on Meta::CPAN

    $store->bag->each(sub { ... });
    $store->bag->take(10)->each(sub { ... });

    # Search
    # Any extra arguments will be passed on as is to Solr
    my $hits = $store->bag->search(query => 'name:Patrick');

=cut

has url        => (is => 'ro', default => sub {'http://localhost:8983/solr'});
has keep_alive => (is => 'ro', default => sub {0});
has solr    => (is => 'lazy');
has bag_key => (is => 'lazy', alias => 'bag_field');
has on_error => (
    is  => 'ro',
    isa => sub {
        array_includes([qw(throw ignore)], $_[0])
            or die("on_error must be 'throw' or 'ignore'");
    },
    lazy    => 1,
    default => sub {"throw"}

lib/Catmandu/Store/Solr.pm  view on Meta::CPAN

    $orig->($self, @_);
};

sub _build_solr {
    my ($self) = @_;
    WebService::Solr->new(
        $_[0]->url,
        {
            autocommit     => 0,
            default_params => {wt => 'json'},
            agent => LWP::UserAgent->new(keep_alive => $self->keep_alive),
        }
    );
}

sub _build_bag_key {
    $_[0]->key_for('bag');
}

sub transaction {
    my ($self, $sub) = @_;



( run in 2.605 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )