Skip to content

Commit 4b63ed0

Browse files
committed
Add patterned_text feature_flag
1 parent 6856d2d commit 4b63ed0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ public List<ActionPlugin.ActionHandler> getActions() {
106106

107107
@Override
108108
public Map<String, Mapper.TypeParser> getMappers() {
109-
return singletonMap(PatternedTextFieldType.CONTENT_TYPE, PatternedTextFieldMapper.PARSER);
109+
if (PatternedTextFieldMapper.PATTERNED_TEXT_MAPPER.isEnabled()) {
110+
return singletonMap(PatternedTextFieldType.CONTENT_TYPE, PatternedTextFieldMapper.PARSER);
111+
} else {
112+
return Map.of();
113+
}
110114
}
111115

112116
protected XPackLicenseState getLicenseState() {

x-pack/plugin/logsdb/src/main/java/org/elasticsearch/xpack/logsdb/patternedtext/PatternedTextFieldMapper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.apache.lucene.document.SortedSetDocValuesField;
1313
import org.apache.lucene.index.IndexOptions;
1414
import org.apache.lucene.util.BytesRef;
15+
import org.elasticsearch.common.util.FeatureFlag;
1516
import org.elasticsearch.index.IndexVersion;
1617
import org.elasticsearch.index.analysis.IndexAnalyzers;
1718
import org.elasticsearch.index.analysis.NamedAnalyzer;
@@ -30,6 +31,8 @@
3031
*/
3132
public class PatternedTextFieldMapper extends FieldMapper {
3233

34+
public static final FeatureFlag PATTERNED_TEXT_MAPPER = new FeatureFlag("patterned_text");
35+
3336
public static class Defaults {
3437
public static final FieldType FIELD_TYPE;
3538

0 commit comments

Comments
 (0)