Lines 115-129
sub update_index {
Link Here
|
115 |
my $response; |
115 |
my $response; |
116 |
if (@body) { |
116 |
if (@body) { |
117 |
try{ |
117 |
try{ |
118 |
my $elasticsearch = $self->get_elasticsearch(); |
118 |
my $elasticsearch = $self->get_elasticsearch(); |
119 |
$response = $elasticsearch->bulk( |
119 |
$response = $elasticsearch->bulk( |
120 |
index => $self->index_name, |
120 |
index => $self->index_name, |
121 |
type => 'data', # is just hard coded in Indexer.pm? |
121 |
type => 'data', # is just hard coded in Indexer.pm? |
122 |
body => \@body |
122 |
body => \@body |
123 |
); |
123 |
); |
124 |
if ($response->{errors}) { |
124 |
if ($response->{errors}) { |
125 |
carp "One or more ElasticSearch errors occurred when indexing documents"; |
125 |
carp "One or more ElasticSearch errors occurred when indexing documents"; |
126 |
} |
126 |
} |
127 |
} catch { |
127 |
} catch { |
128 |
if( ref $_ eq 'Search::Elasticsearch::Error::Timeout' ){ |
128 |
if( ref $_ eq 'Search::Elasticsearch::Error::Timeout' ){ |
129 |
Koha::Exceptions::Elasticsearch::BadResponse->throw( |
129 |
Koha::Exceptions::Elasticsearch::BadResponse->throw( |