=cut
sub count {
- my ($self, $query) = @_;
+ my ( $self, $query ) = @_;
my $params = $self->get_elasticsearch_params();
$self->store(
Catmandu::Store::ElasticSearch->new( %$params, trace_calls => 1, ) );
-# TODO something like this should work, but doesn't seem to just yet.
-# my $count = $self->store->bag->count($query);
+
+ # TODO something like this should work, but doesn't seem to just yet.
+ # my $count = $self->store->bag->count($query);
my $count = $self->store->bag->search(%$query)->total;
return $count;
}
# use Data::Dumper;
# die Dumper(\@marclist, \@and_or,
# \@excluding, \@operator, \@value, $authtypecode, $orderby, $query);
+ # The searchengine API expects pages to start at page 1
+ $startfrom = defined($startfrom) ? $startfrom+1 : undef;
my ( $results, $total ) =
$searcher->search_auth_compat( $search_query, $startfrom, $resultsperpage );
( $template, $loggedinuser, $cookie ) = get_template_and_user(