Skip to content

Commit 3a9b657

Browse files
authored
Move stored flag from TextSearchInfo to MappedFieldType (#62717)
1 parent 42f1ceb commit 3a9b657

File tree

84 files changed

+257
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+257
-268
lines changed

modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/RankFeatureFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static final class RankFeatureFieldType extends MappedFieldType {
100100
private final boolean positiveScoreImpact;
101101

102102
public RankFeatureFieldType(String name, Map<String, String> meta, boolean positiveScoreImpact) {
103-
super(name, true, false, TextSearchInfo.NONE, meta);
103+
super(name, true, false, false, TextSearchInfo.NONE, meta);
104104
this.positiveScoreImpact = positiveScoreImpact;
105105
setIndexAnalyzer(Lucene.KEYWORD_ANALYZER);
106106
}

modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/RankFeatureMetaFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static final class RankFeatureMetaFieldType extends MappedFieldType {
4242
public static final RankFeatureMetaFieldType INSTANCE = new RankFeatureMetaFieldType();
4343

4444
private RankFeatureMetaFieldType() {
45-
super(NAME, false, false, TextSearchInfo.NONE, Collections.emptyMap());
45+
super(NAME, false, false, false, TextSearchInfo.NONE, Collections.emptyMap());
4646
}
4747

4848
@Override

modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/RankFeaturesFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public Mapper.Builder<?> parse(String name, Map<String, Object> node, ParserCont
7878
public static final class RankFeaturesFieldType extends MappedFieldType {
7979

8080
public RankFeaturesFieldType(String name, Map<String, String> meta) {
81-
super(name, false, false, TextSearchInfo.NONE, meta);
81+
super(name, false, false, false, TextSearchInfo.NONE, meta);
8282
setIndexAnalyzer(Lucene.KEYWORD_ANALYZER);
8383
}
8484

modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/ScaledFloatFieldMapper.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ protected List<Parameter<?>> getParameters() {
125125

126126
@Override
127127
public ScaledFloatFieldMapper build(BuilderContext context) {
128-
ScaledFloatFieldType type = new ScaledFloatFieldType(buildFullName(context), indexed.getValue(), hasDocValues.getValue(),
129-
meta.getValue(), scalingFactor.getValue());
128+
ScaledFloatFieldType type = new ScaledFloatFieldType(buildFullName(context), indexed.getValue(), stored.getValue(),
129+
hasDocValues.getValue(), meta.getValue(), scalingFactor.getValue());
130130
return new ScaledFloatFieldMapper(name, type, multiFieldsBuilder.build(this, context), copyTo.build(), this);
131131
}
132132
}
@@ -137,13 +137,14 @@ public static final class ScaledFloatFieldType extends SimpleMappedFieldType {
137137

138138
private final double scalingFactor;
139139

140-
public ScaledFloatFieldType(String name, boolean indexed, boolean hasDocValues, Map<String, String> meta, double scalingFactor) {
141-
super(name, indexed, hasDocValues, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
140+
public ScaledFloatFieldType(String name, boolean indexed, boolean stored, boolean hasDocValues,
141+
Map<String, String> meta, double scalingFactor) {
142+
super(name, indexed, stored, hasDocValues, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
142143
this.scalingFactor = scalingFactor;
143144
}
144145

145146
public ScaledFloatFieldType(String name, double scalingFactor) {
146-
this(name, true, true, Collections.emptyMap(), scalingFactor);
147+
this(name, true, false, true, Collections.emptyMap(), scalingFactor);
147148
}
148149

149150
public double getScalingFactor() {

modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/SearchAsYouTypeFieldMapper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ static class SearchAsYouTypeFieldType extends StringFieldType {
249249

250250
SearchAsYouTypeFieldType(String name, FieldType fieldType, SimilarityProvider similarity,
251251
NamedAnalyzer searchAnalyzer, NamedAnalyzer searchQuoteAnalyzer, Map<String, String> meta) {
252-
super(name, fieldType.indexOptions() != IndexOptions.NONE, false,
252+
super(name, fieldType.indexOptions() != IndexOptions.NONE, fieldType.stored(), false,
253253
new TextSearchInfo(fieldType, similarity, searchAnalyzer, searchQuoteAnalyzer), meta);
254254
}
255255

@@ -354,7 +354,7 @@ static final class PrefixFieldType extends StringFieldType {
354354
final String parentField;
355355

356356
PrefixFieldType(String parentField, TextSearchInfo textSearchInfo, int minChars, int maxChars) {
357-
super(parentField + PREFIX_FIELD_SUFFIX, true, false, textSearchInfo, Collections.emptyMap());
357+
super(parentField + PREFIX_FIELD_SUFFIX, true, false, false, textSearchInfo, Collections.emptyMap());
358358
this.minChars = minChars;
359359
this.maxChars = maxChars;
360360
this.parentField = parentField;
@@ -487,7 +487,7 @@ static class ShingleFieldType extends StringFieldType {
487487
PrefixFieldType prefixFieldType;
488488

489489
ShingleFieldType(String name, int shingleSize, TextSearchInfo textSearchInfo) {
490-
super(name, true, false, textSearchInfo, Collections.emptyMap());
490+
super(name, true, false, false, textSearchInfo, Collections.emptyMap());
491491
this.shingleSize = shingleSize;
492492
}
493493

modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/ScaledFloatFieldTypeTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void testRangeQuery() throws IOException {
6565
// this test checks that searching scaled floats yields the same results as
6666
// searching doubles that are rounded to the closest half float
6767
ScaledFloatFieldMapper.ScaledFloatFieldType ft = new ScaledFloatFieldMapper.ScaledFloatFieldType(
68-
"scaled_float", true, false, Collections.emptyMap(), 0.1 + randomDouble() * 100);
68+
"scaled_float", true, false, false, Collections.emptyMap(), 0.1 + randomDouble() * 100);
6969
Directory dir = newDirectory();
7070
IndexWriter w = new IndexWriter(dir, new IndexWriterConfig(null));
7171
final int numDocs = 1000;

modules/parent-join/src/main/java/org/elasticsearch/join/mapper/MetaJoinFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static class MetaJoinFieldType extends StringFieldType {
8282
private final String joinField;
8383

8484
MetaJoinFieldType(String joinField) {
85-
super(NAME, false, false, TextSearchInfo.SIMPLE_MATCH_ONLY, Collections.emptyMap());
85+
super(NAME, false, false, false, TextSearchInfo.SIMPLE_MATCH_ONLY, Collections.emptyMap());
8686
this.joinField = joinField;
8787
}
8888

modules/parent-join/src/main/java/org/elasticsearch/join/mapper/ParentIdFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public ParentIdFieldMapper build(BuilderContext context) {
9999

100100
public static final class ParentIdFieldType extends StringFieldType {
101101
ParentIdFieldType(String name, boolean eagerGlobalOrdinals, Map<String, String> meta) {
102-
super(name, true, true, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
102+
super(name, true, false, true, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
103103
setIndexAnalyzer(Lucene.KEYWORD_ANALYZER);
104104
setEagerGlobalOrdinals(eagerGlobalOrdinals);
105105
}

modules/parent-join/src/main/java/org/elasticsearch/join/mapper/ParentJoinFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public Mapper.Builder<?> parse(String name, Map<String, Object> node, ParserCont
210210

211211
public static final class JoinFieldType extends StringFieldType {
212212
public JoinFieldType(String name, Map<String, String> meta) {
213-
super(name, true, true, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
213+
super(name, true, false, true, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
214214
setIndexAnalyzer(Lucene.KEYWORD_ANALYZER);
215215
}
216216

modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static class PercolatorFieldType extends MappedFieldType {
195195
boolean mapUnmappedFieldsAsText;
196196

197197
PercolatorFieldType(String name, Map<String, String> meta) {
198-
super(name, false, false, TextSearchInfo.NONE, meta);
198+
super(name, false, false, false, TextSearchInfo.NONE, meta);
199199
}
200200

201201
@Override

0 commit comments

Comments
 (0)