Skip to content

Commit 279c349

Browse files
Fix index.mapping.pattern_text.disable_templating not registered issue (#138265)
* Fix index.mapping.pattern_text.disable_templating has not been registered issue * Update docs/changelog/138265.yaml * gate versions that do not have pattern_text
1 parent 15709dd commit 279c349

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

docs/changelog/138265.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138265
2+
summary: Fix `index.mapping.pattern_text.disable_templating` not registered issue
3+
area: Mapping
4+
type: bug
5+
issues: []
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.upgrades;
11+
12+
import com.carrotsearch.randomizedtesting.annotations.Name;
13+
14+
public class PatternTextRollingUpgradeIT extends AbstractStringTypeRollingUpgradeIT {
15+
16+
public PatternTextRollingUpgradeIT(@Name("upgradedNodes") int upgradedNodes) {
17+
super(upgradedNodes);
18+
}
19+
20+
@Override
21+
public String stringType() {
22+
return "pattern_text";
23+
}
24+
25+
@Override
26+
protected void testIndexing(boolean shouldIncludeKeywordMultiField) throws Exception {
27+
assumeTrue("pattern_text only available from 9.2.0 onward", oldClusterHasFeature("gte_v9.2.0"));
28+
super.testIndexing(shouldIncludeKeywordMultiField);
29+
}
30+
}

x-pack/plugin/logsdb/src/main/java/org/elasticsearch/xpack/logsdb/patterntext/PatternTextFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ private static Parameter<NamedAnalyzer> analyzerParam(String name, Function<Fiel
168168
* associated index setting, which is set from the current license status.
169169
*/
170170
private static Parameter<Boolean> disableTemplatingParameter(IndexSettings indexSettings) {
171-
boolean forceDisable = indexSettings.getValue(DISABLE_TEMPLATING_SETTING);
171+
boolean forceDisable = DISABLE_TEMPLATING_SETTING.get(indexSettings.getSettings());
172172
return Parameter.boolParam(
173173
"disable_templating",
174174
false,

0 commit comments

Comments
 (0)