Skip to content

Commit

Permalink
Adapt to recent index versioning changes
Browse files Browse the repository at this point in the history
  • Loading branch information
weltenwort committed Jul 9, 2021
1 parent 074af00 commit 164b53a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export const createRuleDataClient = ({
`${registrationContext}-mappings`
);

const indexNamePattern = ruleDataService.getFullAssetName(`${registrationContext}*`);

if (!ruleDataService.isWriteEnabled()) {
return;
}
Expand Down Expand Up @@ -61,13 +63,15 @@ export const createRuleDataClient = ({
await ruleDataService.createOrUpdateIndexTemplate({
name: ruleDataService.getFullAssetName(registrationContext),
body: {
index_patterns: [ruleDataService.getFullAssetName(`${registrationContext}*`)],
index_patterns: [indexNamePattern],
composed_of: [
ruleDataService.getFullAssetName(TECHNICAL_COMPONENT_TEMPLATE_NAME),
componentTemplateName,
],
},
});

await ruleDataService.updateIndexMappingsMatchingPattern(indexNamePattern);
});

// initialize eagerly
Expand Down

0 comments on commit 164b53a

Please sign in to comment.