Skip to content

Commit 0403168

Browse files
committed
improve settings for index creation
1 parent 6798cd6 commit 0403168

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/MetaCPAN/ESConfig.pm

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,6 @@ const my %config => merge(
126126
use Moo;
127127
}
128128

129-
has indexes => (
130-
is => 'ro',
131-
required => 1,
132-
);
133-
134129
has all_indexes => (
135130
is => 'lazy',
136131
default => sub ($self) {

lib/MetaCPAN/Script/Mapping.pm

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,12 @@ sub create_index {
336336

337337
# create the new index with the copied settings
338338
log_info {"Creating index: $dst_idx"};
339-
$self->es->indices->create( index => $dst_idx, body => $index_settings );
339+
$self->es->indices->create(
340+
index => $dst_idx,
341+
body => {
342+
settings => $index_settings,
343+
},
344+
);
340345

341346
# override with new type mapping
342347
if ( $self->patch_mapping ) {
@@ -526,7 +531,7 @@ sub _build_index_config {
526531
};
527532
}
528533

529-
return $mappings;
534+
return $indices;
530535
}
531536

532537
sub deploy_mapping {
@@ -791,7 +796,7 @@ sub indices_valid {
791796
&& $config_indices->{$idx}->{'mappings'};
792797
my $deploy_mappings = $deploy_indices->{$idx}
793798
&& $deploy_indices->{$idx}->{'mappings'};
794-
if ( !$deploy ) {
799+
if ( !$deploy_mappings ) {
795800
log_error {"Missing index: $idx"};
796801
$valid = 0;
797802
next;

0 commit comments

Comments
 (0)