Skip to content

Commit 1b25b4a

Browse files
revert back all changes from MappedFieldtype and subclasses
1 parent b549efc commit 1b25b4a

File tree

8 files changed

+11
-132
lines changed

8 files changed

+11
-132
lines changed

server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ public static final class Builder extends FieldMapper.DimensionBuilder {
205205
private final IndexVersion indexCreatedVersion;
206206
private final boolean useDocValuesSkipper;
207207
private final SourceKeepMode indexSourceKeepMode;
208-
private boolean excludeFromFieldCaps = false;
209208

210209
public Builder(final String name, final MappingParserContext mappingParserContext) {
211210
this(
@@ -301,11 +300,6 @@ public Builder ignoreAbove(int ignoreAbove) {
301300
return this;
302301
}
303302

304-
public Builder excludeFromFieldCaps(boolean value) {
305-
this.excludeFromFieldCaps = value;
306-
return this;
307-
}
308-
309303
Builder normalizer(String normalizerName) {
310304
this.normalizer.setValue(normalizerName);
311305
return this;
@@ -415,8 +409,7 @@ private KeywordFieldType buildFieldType(MapperBuilderContext context, FieldType
415409
searchAnalyzer,
416410
quoteAnalyzer,
417411
this,
418-
context.isSourceSynthetic(),
419-
excludeFromFieldCaps
412+
context.isSourceSynthetic()
420413
);
421414
}
422415

@@ -523,28 +516,14 @@ public KeywordFieldType(
523516
NamedAnalyzer quoteAnalyzer,
524517
Builder builder,
525518
boolean isSyntheticSource
526-
) {
527-
this(name, fieldType, normalizer, searchAnalyzer, quoteAnalyzer, builder, isSyntheticSource, false);
528-
}
529-
530-
public KeywordFieldType(
531-
String name,
532-
FieldType fieldType,
533-
NamedAnalyzer normalizer,
534-
NamedAnalyzer searchAnalyzer,
535-
NamedAnalyzer quoteAnalyzer,
536-
Builder builder,
537-
boolean isSyntheticSource,
538-
boolean excludeFromFieldCaps
539519
) {
540520
super(
541521
name,
542522
fieldType.indexOptions() != IndexOptions.NONE && builder.indexCreatedVersion.isLegacyIndexVersion() == false,
543523
fieldType.stored(),
544524
builder.hasDocValues.getValue(),
545525
textSearchInfo(fieldType, builder.similarity.getValue(), searchAnalyzer, quoteAnalyzer),
546-
builder.meta.getValue(),
547-
excludeFromFieldCaps
526+
builder.meta.getValue()
548527
);
549528
this.eagerGlobalOrdinals = builder.eagerGlobalOrdinals.getValue();
550529
this.normalizer = normalizer;

server/src/main/java/org/elasticsearch/index/mapper/MappedFieldType.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ public abstract class MappedFieldType {
6868
private final boolean isStored;
6969
private final TextSearchInfo textSearchInfo;
7070
private final Map<String, String> meta;
71-
private final boolean excludeFromFieldCaps;
7271

7372
public MappedFieldType(
7473
String name,
@@ -77,18 +76,6 @@ public MappedFieldType(
7776
boolean hasDocValues,
7877
TextSearchInfo textSearchInfo,
7978
Map<String, String> meta
80-
) {
81-
this(name, isIndexed, isStored, hasDocValues, textSearchInfo, meta, false);
82-
}
83-
84-
public MappedFieldType(
85-
String name,
86-
boolean isIndexed,
87-
boolean isStored,
88-
boolean hasDocValues,
89-
TextSearchInfo textSearchInfo,
90-
Map<String, String> meta,
91-
boolean excludeFromFieldCaps
9279
) {
9380
this.name = Mapper.internFieldName(name);
9481
this.isIndexed = isIndexed;
@@ -98,7 +85,6 @@ public MappedFieldType(
9885
// meta should be sorted but for the one item or empty case we can fall back to immutable maps to save some memory since order is
9986
// irrelevant
10087
this.meta = meta.size() <= 1 ? Map.copyOf(meta) : meta;
101-
this.excludeFromFieldCaps = excludeFromFieldCaps;
10288
}
10389

10490
/**
@@ -184,13 +170,6 @@ public final boolean isStored() {
184170
return isStored;
185171
}
186172

187-
/**
188-
* @return true if the field should be excluded from field caps
189-
*/
190-
public boolean excludeFromFieldCaps() {
191-
return excludeFromFieldCaps;
192-
}
193-
194173
/**
195174
* If the field supports using the indexed data to speed up operations related to ordering of data, such as sorting or aggs, return
196175
* a function for doing that. If it is unsupported for this field type, there is no need to override this method.

server/src/main/java/org/elasticsearch/index/mapper/SimpleMappedFieldType.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,7 @@ protected SimpleMappedFieldType(
3030
TextSearchInfo textSearchInfo,
3131
Map<String, String> meta
3232
) {
33-
this(name, isIndexed, isStored, hasDocValues, textSearchInfo, meta, false);
34-
}
35-
36-
protected SimpleMappedFieldType(
37-
String name,
38-
boolean isIndexed,
39-
boolean isStored,
40-
boolean hasDocValues,
41-
TextSearchInfo textSearchInfo,
42-
Map<String, String> meta,
43-
boolean excludeFromFieldCaps
44-
) {
45-
super(name, isIndexed, isStored, hasDocValues, textSearchInfo, meta, excludeFromFieldCaps);
33+
super(name, isIndexed, isStored, hasDocValues, textSearchInfo, meta);
4634
}
4735

4836
@Override

server/src/main/java/org/elasticsearch/index/mapper/StringFieldType.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,7 @@ public StringFieldType(
5151
TextSearchInfo textSearchInfo,
5252
Map<String, String> meta
5353
) {
54-
this(name, isIndexed, isStored, hasDocValues, textSearchInfo, meta, false);
55-
}
56-
57-
public StringFieldType(
58-
String name,
59-
boolean isIndexed,
60-
boolean isStored,
61-
boolean hasDocValues,
62-
TextSearchInfo textSearchInfo,
63-
Map<String, String> meta,
64-
boolean excludeFromFieldCaps
65-
) {
66-
super(name, isIndexed, isStored, hasDocValues, textSearchInfo, meta, excludeFromFieldCaps);
54+
super(name, isIndexed, isStored, hasDocValues, textSearchInfo, meta);
6755
}
6856

6957
@Override

server/src/main/java/org/elasticsearch/index/mapper/TermBasedFieldType.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,7 @@ public TermBasedFieldType(
3434
TextSearchInfo textSearchInfo,
3535
Map<String, String> meta
3636
) {
37-
this(name, isIndexed, isStored, hasDocValues, textSearchInfo, meta, false);
38-
}
39-
40-
public TermBasedFieldType(
41-
String name,
42-
boolean isIndexed,
43-
boolean isStored,
44-
boolean hasDocValues,
45-
TextSearchInfo textSearchInfo,
46-
Map<String, String> meta,
47-
boolean excludeFromFieldCaps
48-
) {
49-
super(name, isIndexed, isStored, hasDocValues, textSearchInfo, meta, excludeFromFieldCaps);
37+
super(name, isIndexed, isStored, hasDocValues, textSearchInfo, meta);
5038
}
5139

5240
/** Returns the indexed value used to construct search "values".

server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ public static class Builder extends FieldMapper.Builder {
247247
private final Parameter<Map<String, String>> meta = Parameter.metaParam();
248248

249249
final IndexVersion indexVersionCreated;
250-
private boolean excludeFromFieldCaps = false;
251250

252251
public Builder(String name, IndexVersion indexVersionCreated) {
253252
super(name);
@@ -362,11 +361,6 @@ public Builder indexOptions(IndexOptions indexOptions) {
362361
return this;
363362
}
364363

365-
public Builder excludeFromFieldCaps(boolean value) {
366-
this.excludeFromFieldCaps = value;
367-
return this;
368-
}
369-
370364
@Override
371365
public DenseVectorFieldMapper build(MapperBuilderContext context) {
372366
DenseVectorFieldType denseVectorFieldType = new DenseVectorFieldType(
@@ -377,8 +371,7 @@ public DenseVectorFieldMapper build(MapperBuilderContext context) {
377371
indexed.getValue(),
378372
similarity.getValue(),
379373
indexOptions.getValue(),
380-
meta.getValue(),
381-
excludeFromFieldCaps
374+
meta.getValue()
382375
);
383376
// Validate again here because the dimensions or element type could have been set programmatically,
384377
// which affects index option validity
@@ -2157,21 +2150,7 @@ public DenseVectorFieldType(
21572150
IndexOptions indexOptions,
21582151
Map<String, String> meta
21592152
) {
2160-
this(name, indexVersionCreated, elementType, dims, indexed, similarity, indexOptions, meta, false);
2161-
}
2162-
2163-
public DenseVectorFieldType(
2164-
String name,
2165-
IndexVersion indexVersionCreated,
2166-
ElementType elementType,
2167-
Integer dims,
2168-
boolean indexed,
2169-
VectorSimilarity similarity,
2170-
IndexOptions indexOptions,
2171-
Map<String, String> meta,
2172-
boolean excludeFromFieldCaps
2173-
) {
2174-
super(name, indexed, false, indexed == false, TextSearchInfo.NONE, meta, excludeFromFieldCaps);
2153+
super(name, indexed, false, indexed == false, TextSearchInfo.NONE, meta);
21752154
this.elementType = elementType;
21762155
this.dims = dims;
21772156
this.indexed = indexed;

server/src/main/java/org/elasticsearch/index/mapper/vectors/SparseVectorFieldMapper.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ private static SparseVectorFieldMapper toType(FieldMapper in) {
7373
public static class Builder extends FieldMapper.Builder {
7474
private final Parameter<Boolean> stored = Parameter.storeParam(m -> toType(m).fieldType().isStored(), false);
7575
private final Parameter<Map<String, String>> meta = Parameter.metaParam();
76-
private boolean excludeFromFieldCaps = false;
7776

7877
public Builder(String name) {
7978
super(name);
@@ -84,11 +83,6 @@ public Builder setStored(boolean value) {
8483
return this;
8584
}
8685

87-
public Builder excludeFromFieldCaps(boolean value) {
88-
excludeFromFieldCaps = value;
89-
return this;
90-
}
91-
9286
@Override
9387
protected Parameter<?>[] getParameters() {
9488
return new Parameter<?>[] { stored, meta };
@@ -99,8 +93,7 @@ public SparseVectorFieldMapper build(MapperBuilderContext context) {
9993
SparseVectorFieldType sparseVectorFieldType = new SparseVectorFieldType(
10094
context.buildFullName(leafName()),
10195
stored.getValue(),
102-
meta.getValue(),
103-
excludeFromFieldCaps
96+
meta.getValue()
10497
);
10598
return new SparseVectorFieldMapper(leafName(), sparseVectorFieldType, builderParams(this, context));
10699
}
@@ -119,11 +112,7 @@ public SparseVectorFieldMapper build(MapperBuilderContext context) {
119112
public static final class SparseVectorFieldType extends MappedFieldType {
120113

121114
public SparseVectorFieldType(String name, boolean isStored, Map<String, String> meta) {
122-
this(name, isStored, meta, false);
123-
}
124-
125-
public SparseVectorFieldType(String name, boolean isStored, Map<String, String> meta, boolean excludeFromFieldCaps) {
126-
super(name, true, isStored, false, TextSearchInfo.SIMPLE_MATCH_ONLY, meta, excludeFromFieldCaps);
115+
super(name, true, isStored, false, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
127116
}
128117

129118
@Override

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/mapper/OffsetSourceFieldMapper.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,11 @@ public static class Builder extends FieldMapper.Builder {
107107
CharsetFormat.class
108108
);
109109
private final Parameter<Map<String, String>> meta = Parameter.metaParam();
110-
private boolean excludeFromFieldCaps = false;
111110

112111
public Builder(String name) {
113112
super(name);
114113
}
115114

116-
public Builder excludeFromFieldCaps(boolean value) {
117-
excludeFromFieldCaps = value;
118-
return this;
119-
}
120-
121115
@Override
122116
protected Parameter<?>[] getParameters() {
123117
return new Parameter<?>[] { meta, charset };
@@ -128,8 +122,7 @@ public OffsetSourceFieldMapper build(MapperBuilderContext context) {
128122
OffsetSourceFieldType fieldType = new OffsetSourceFieldType(
129123
context.buildFullName(leafName()),
130124
charset.get(),
131-
meta.getValue(),
132-
this.excludeFromFieldCaps
125+
meta.getValue()
133126
);
134127

135128
return new OffsetSourceFieldMapper(leafName(), fieldType, builderParams(this, context));
@@ -142,11 +135,7 @@ public static final class OffsetSourceFieldType extends MappedFieldType {
142135
private final CharsetFormat charset;
143136

144137
public OffsetSourceFieldType(String name, CharsetFormat charset, Map<String, String> meta) {
145-
this(name, charset, meta, false);
146-
}
147-
148-
public OffsetSourceFieldType(String name, CharsetFormat charset, Map<String, String> meta, boolean excludeFromFieldCaps) {
149-
super(name, true, false, false, TextSearchInfo.NONE, meta, excludeFromFieldCaps);
138+
super(name, true, false, false, TextSearchInfo.NONE, meta);
150139
this.charset = charset;
151140
}
152141

0 commit comments

Comments
 (0)