View | Details | Raw Unified | Return to bug 24823
Collapse All | Expand All

(-)a/Koha/SearchEngine/Elasticsearch/Browse.pm (-12 / +7 lines)
Lines 49-58 as "suggestible" in the database when indexing takes place. Link Here
49
use base qw(Koha::SearchEngine::Elasticsearch);
49
use base qw(Koha::SearchEngine::Elasticsearch);
50
use Modern::Perl;
50
use Modern::Perl;
51
51
52
use Catmandu::Store::ElasticSearch;
53
54
Koha::SearchEngine::Elasticsearch::Browse->mk_accessors(qw( store ));
55
56
=head2 browse
52
=head2 browse
57
53
58
    my $results = $browser->browse($prefix, $field, \%options);
54
    my $results = $browser->browse($prefix, $field, \%options);
Lines 108-122 in order of some form of relevance. Link Here
108
sub browse {
104
sub browse {
109
    my ($self, $prefix, $field, $options) = @_;
105
    my ($self, $prefix, $field, $options) = @_;
110
106
111
    my $params = $self->get_elasticsearch_params();
112
    $self->store(
113
        Catmandu::Store::ElasticSearch->new(
114
            %$params,
115
        )
116
    ) unless $self->store;
117
118
    my $query = $self->_build_query($prefix, $field, $options);
107
    my $query = $self->_build_query($prefix, $field, $options);
119
    my $results = $self->store->bag->search(%$query);
108
    my $elasticsearch = $self->get_elasticsearch();
109
    my $conf = $self->get_elasticsearch_params();
110
    my $results = $elasticsearch->search(
111
        index => $conf->{index_name},
112
        body => $query
113
    );
114
120
    return $results->{suggest}{suggestions}[0]{options};
115
    return $results->{suggest}{suggestions}[0]{options};
121
}
116
}
122
117
(-)a/Koha/SearchEngine/Elasticsearch/Indexer.pm (-1 / +1 lines)
Lines 297-303 sub delete_index { Link Here
297
        body => \@body,
297
        body => \@body,
298
    );
298
    );
299
    if ($result->{errors}) {
299
    if ($result->{errors}) {
300
        croak "An Elasticsearch error occured during bulk delete";
300
        croak "An Elasticsearch error occurred during bulk delete";
301
    }
301
    }
302
}
302
}
303
303
(-)a/cpanfile (-3 lines)
Lines 134-141 recommends 'Archive::Zip', '1.30'; Link Here
134
recommends 'Array::Utils', '0.5';
134
recommends 'Array::Utils', '0.5';
135
recommends 'CGI::Session::Driver::memcached', '0.04';
135
recommends 'CGI::Session::Driver::memcached', '0.04';
136
recommends 'Cache::FastMmap', '1.34';
136
recommends 'Cache::FastMmap', '1.34';
137
recommends 'Catmandu::MARC', '1.241';
138
recommends 'Catmandu::Store::ElasticSearch', '>= 0.0507, <= 0.512';
139
recommends 'DBD::SQLite2', '0.33';
137
recommends 'DBD::SQLite2', '0.33';
140
recommends 'Devel::Cover', '0.89';
138
recommends 'Devel::Cover', '0.89';
141
recommends 'File::Copy', '2.08';
139
recommends 'File::Copy', '2.08';
142
- 

Return to bug 24823