Lines 134-140
sub update_index {
Link Here
|
134 |
my $elasticsearch = $self->get_elasticsearch(); |
134 |
my $elasticsearch = $self->get_elasticsearch(); |
135 |
$response = $elasticsearch->bulk( |
135 |
$response = $elasticsearch->bulk( |
136 |
index => $self->index_name, |
136 |
index => $self->index_name, |
137 |
type => 'data', # is just hard coded in Indexer.pm? |
|
|
138 |
body => \@body |
137 |
body => \@body |
139 |
); |
138 |
); |
140 |
if ($response->{errors}) { |
139 |
if ($response->{errors}) { |
Lines 270-280
sub update_mappings {
Link Here
|
270 |
try { |
269 |
try { |
271 |
my $response = $elasticsearch->indices->put_mapping( |
270 |
my $response = $elasticsearch->indices->put_mapping( |
272 |
index => $self->index_name, |
271 |
index => $self->index_name, |
273 |
type => 'data', |
272 |
body => $mappings, |
274 |
include_type_name => JSON::true(), |
|
|
275 |
body => { |
276 |
data => $mappings |
277 |
} |
278 |
); |
273 |
); |
279 |
} catch { |
274 |
} catch { |
280 |
$self->set_index_status_recreate_required(); |
275 |
$self->set_index_status_recreate_required(); |
Lines 363-369
sub delete_index {
Link Here
|
363 |
my @body = map { { delete => { _id => "$_" } } } @{$biblionums}; |
358 |
my @body = map { { delete => { _id => "$_" } } } @{$biblionums}; |
364 |
my $result = $elasticsearch->bulk( |
359 |
my $result = $elasticsearch->bulk( |
365 |
index => $self->index_name, |
360 |
index => $self->index_name, |
366 |
type => 'data', |
|
|
367 |
body => \@body, |
361 |
body => \@body, |
368 |
); |
362 |
); |
369 |
if ($result->{errors}) { |
363 |
if ($result->{errors}) { |
370 |
- |
|
|