Skip to content

Commit

Permalink
improve settings for index creation
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Oct 30, 2024
1 parent 6798cd6 commit 0403168
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
5 changes: 0 additions & 5 deletions lib/MetaCPAN/ESConfig.pm
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ const my %config => merge(
use Moo;
}

has indexes => (
is => 'ro',
required => 1,
);

has all_indexes => (
is => 'lazy',
default => sub ($self) {
Expand Down
11 changes: 8 additions & 3 deletions lib/MetaCPAN/Script/Mapping.pm
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,12 @@ sub create_index {

# create the new index with the copied settings
log_info {"Creating index: $dst_idx"};
$self->es->indices->create( index => $dst_idx, body => $index_settings );
$self->es->indices->create(
index => $dst_idx,
body => {
settings => $index_settings,
},
);

# override with new type mapping
if ( $self->patch_mapping ) {
Expand Down Expand Up @@ -526,7 +531,7 @@ sub _build_index_config {
};
}

return $mappings;
return $indices;
}

sub deploy_mapping {
Expand Down Expand Up @@ -791,7 +796,7 @@ sub indices_valid {
&& $config_indices->{$idx}->{'mappings'};
my $deploy_mappings = $deploy_indices->{$idx}
&& $deploy_indices->{$idx}->{'mappings'};
if ( !$deploy ) {
if ( !$deploy_mappings ) {
log_error {"Missing index: $idx"};
$valid = 0;
next;
Expand Down

0 comments on commit 0403168

Please sign in to comment.