SolarBeam - Async Solr search driver
0.04
use SolarBeam; my $solr = SolarBeam->new; $solr->search(...);
Interface to acquire Solr index engine connections.
SolarBeam is currently EXPERIMENTAL.
SolarBeam implements the the following attributes.
$ua = $self->ua $self = $self->ua(Mojo::UserAgent->new);
A Mojo::UserAgent compatible object.
$url = $self->url;
Solr endpoint as a Mojo::URL object. Note that passing in "url" as a string to "new" also works.
A hashref with default parameters used for every query.
$self = SolarBeam->new(%attributes);
Object constructor.
$self = $self->search($query, [%options], sub { my ($self, $res) = @_; });
Used to search for data in Solr. $res is a SolarBeam::Response object.
$res
Example $query:
$query
Hash
$self->search({surname => q("Thorsen"), age => [33, 34]});
The query above will result in this Solr query:
(surname:("Thorsen") AND age:(33) OR age:(34))
String
$self->search("active:1");
active:1
%options can hold Solr query parameters and some special instuctions to this module, such a "page" and "rows".
%options
page
Used to calculate the offset together with "rows". Will also be used to set Data::Page attributes in "pager" in SolarBeam::Response:
$res->pager->current_page($page);
rows
Used to calculate the offset together with "page". Will also be used to set Data::Page attributes in "pager" in SolarBeam::Response:
$res->pager->entries_per_page($rows);
$self = $self->autocomplete($prefix, [%options], sub { my ($self, $res) = @_; });
TODO.
$res is a SolarBeam::Response object.
%options can be:
-postfix - defaults to \w+
regex.flag -
regex -
Copyright (C) 2011-2016, Magnus Holm
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
Magnus Holm - judofyr@gmail.com
judofyr@gmail.com
Jan Henning Thorsen - jhthorsen@cpan.org
jhthorsen@cpan.org
Nicolas Mendoza - mendoza@pvv.ntnu.no
mendoza@pvv.ntnu.no
To install SolarBeam, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SolarBeam
CPAN shell
perl -MCPAN -e shell install SolarBeam
For more information on module installation, please visit the detailed CPAN module installation guide.