Skip to content

Commit 57316e2

Browse files
authored
Add text search information to MappedFieldType (#58230)
Now that MappedFieldType no longer extends lucene's FieldType, we need to have a way of getting the index information about a field necessary for building text queries, building term vectors, highlighting, etc. This commit introduces a new TextSearchInfo abstraction that holds this information, and a getTextSearchInfo() method to MappedFieldType to make it available. Field types that do not support text search can just return null here. This allows us to remove the MapperService.getLuceneFieldType() shim method.
1 parent 3a6539e commit 57316e2

File tree

72 files changed

+344
-238
lines changed

Some content is hidden

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

72 files changed

+344
-238
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
@@ -98,7 +98,7 @@ public static final class RankFeatureFieldType extends MappedFieldType {
9898
private final boolean positiveScoreImpact;
9999

100100
public RankFeatureFieldType(String name, Map<String, String> meta, boolean positiveScoreImpact) {
101-
super(name, true, false, meta);
101+
super(name, true, false, TextSearchInfo.NONE, meta);
102102
this.positiveScoreImpact = positiveScoreImpact;
103103
setIndexAnalyzer(Lucene.KEYWORD_ANALYZER);
104104
setSearchAnalyzer(Lucene.KEYWORD_ANALYZER);

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
@@ -82,7 +82,7 @@ public static final class RankFeatureMetaFieldType extends MappedFieldType {
8282
public static final RankFeatureMetaFieldType INSTANCE = new RankFeatureMetaFieldType();
8383

8484
private RankFeatureMetaFieldType() {
85-
super(NAME, false, false, Collections.emptyMap());
85+
super(NAME, false, false, TextSearchInfo.NONE, Collections.emptyMap());
8686
}
8787

8888
protected RankFeatureMetaFieldType(RankFeatureMetaFieldType ref) {

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
@@ -76,7 +76,7 @@ public Mapper.Builder<?> parse(String name, Map<String, Object> node, ParserCont
7676
public static final class RankFeaturesFieldType extends MappedFieldType {
7777

7878
public RankFeaturesFieldType(String name, Map<String, String> meta) {
79-
super(name, false, false, meta);
79+
super(name, false, false, TextSearchInfo.NONE, meta);
8080
setIndexAnalyzer(Lucene.KEYWORD_ANALYZER);
8181
setSearchAnalyzer(Lucene.KEYWORD_ANALYZER);
8282
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public static final class ScaledFloatFieldType extends SimpleMappedFieldType {
185185
private final double scalingFactor;
186186

187187
public ScaledFloatFieldType(String name, boolean indexed, boolean hasDocValues, Map<String, String> meta, double scalingFactor) {
188-
super(name, indexed, hasDocValues, meta);
188+
super(name, indexed, hasDocValues, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
189189
this.scalingFactor = scalingFactor;
190190
}
191191

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

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,19 @@ public Builder docValues(boolean docValues) {
157157
@Override
158158
public SearchAsYouTypeFieldMapper build(Mapper.BuilderContext context) {
159159

160-
boolean hasNorms = fieldType.omitNorms() == false;
161-
SearchAsYouTypeFieldType ft = new SearchAsYouTypeFieldType(buildFullName(context), indexed, meta, hasNorms);
160+
SearchAsYouTypeFieldType ft = new SearchAsYouTypeFieldType(buildFullName(context), fieldType, meta);
162161
ft.setIndexAnalyzer(indexAnalyzer);
163162
ft.setSearchAnalyzer(searchAnalyzer);
164163
ft.setSearchQuoteAnalyzer(searchQuoteAnalyzer);
165164
ft.setSimilarity(similarity);
166165

167166
// set up the prefix field
167+
FieldType prefixft = new FieldType(fieldType);
168+
prefixft.setStoreTermVectors(false);
169+
prefixft.setOmitNorms(true);
170+
prefixft.setStored(false);
168171
final String fullName = buildFullName(context);
169-
final PrefixFieldType prefixFieldType = new PrefixFieldType(fullName, Defaults.MIN_GRAM, Defaults.MAX_GRAM);
172+
final PrefixFieldType prefixFieldType = new PrefixFieldType(fullName, prefixft, Defaults.MIN_GRAM, Defaults.MAX_GRAM);
170173
// wrap the root field's index analyzer with shingles and edge ngrams
171174
final SearchAsYouTypeAnalyzer prefixIndexWrapper =
172175
SearchAsYouTypeAnalyzer.withShingleAndPrefix(indexAnalyzer.analyzer(), maxShingleSize);
@@ -176,19 +179,17 @@ public SearchAsYouTypeFieldMapper build(Mapper.BuilderContext context) {
176179
// don't wrap the root field's search quote analyzer as prefix field doesn't support phrase queries
177180
prefixFieldType.setIndexAnalyzer(new NamedAnalyzer(indexAnalyzer.name(), AnalyzerScope.INDEX, prefixIndexWrapper));
178181
prefixFieldType.setSearchAnalyzer(new NamedAnalyzer(searchAnalyzer.name(), AnalyzerScope.INDEX, prefixSearchWrapper));
179-
FieldType prefixft = new FieldType(fieldType);
180-
prefixft.setStoreTermVectors(false);
181-
prefixft.setOmitNorms(true);
182-
prefixft.setStored(false);
183182
final PrefixFieldMapper prefixFieldMapper = new PrefixFieldMapper(prefixft, prefixFieldType);
184183

185184
// set up the shingle fields
186185
final ShingleFieldMapper[] shingleFieldMappers = new ShingleFieldMapper[maxShingleSize - 1];
187186
final ShingleFieldType[] shingleFieldTypes = new ShingleFieldType[maxShingleSize - 1];
188187
for (int i = 0; i < shingleFieldMappers.length; i++) {
189188
final int shingleSize = i + 2;
189+
FieldType shingleft = new FieldType(fieldType);
190+
shingleft.setStored(false);
190191
String fieldName = getShingleFieldName(buildFullName(context), shingleSize);
191-
final ShingleFieldType shingleFieldType = new ShingleFieldType(fieldName, shingleSize, hasNorms);
192+
final ShingleFieldType shingleFieldType = new ShingleFieldType(fieldName, shingleSize, shingleft);
192193
// wrap the root field's index, search, and search quote analyzers with shingles
193194
final SearchAsYouTypeAnalyzer shingleIndexWrapper =
194195
SearchAsYouTypeAnalyzer.withShingle(indexAnalyzer.analyzer(), shingleSize);
@@ -202,8 +203,6 @@ public SearchAsYouTypeFieldMapper build(Mapper.BuilderContext context) {
202203
new NamedAnalyzer(searchQuoteAnalyzer.name(), AnalyzerScope.INDEX, shingleSearchQuoteWrapper));
203204
shingleFieldType.setPrefixFieldType(prefixFieldType);
204205
shingleFieldTypes[i] = shingleFieldType;
205-
FieldType shingleft = new FieldType(fieldType);
206-
shingleft.setStored(false);
207206
shingleFieldMappers[i] = new ShingleFieldMapper(shingleft, shingleFieldType);
208207
}
209208
ft.setPrefixField(prefixFieldType);
@@ -235,12 +234,9 @@ static class SearchAsYouTypeFieldType extends StringFieldType {
235234

236235
PrefixFieldType prefixField;
237236
ShingleFieldType[] shingleFields = new ShingleFieldType[0];
238-
final boolean hasNorms;
239237

240-
SearchAsYouTypeFieldType(String name, boolean indexed, Map<String, String> meta, boolean hasNorms) {
241-
super(name, indexed, false, meta);
242-
this.hasNorms = hasNorms;
243-
this.hasPositions = true;
238+
SearchAsYouTypeFieldType(String name, FieldType fieldType, Map<String, String> meta) {
239+
super(name, fieldType.indexOptions() != IndexOptions.NONE, false, new TextSearchInfo(fieldType), meta);
244240
}
245241

246242
SearchAsYouTypeFieldType(SearchAsYouTypeFieldType other) {
@@ -257,7 +253,6 @@ static class SearchAsYouTypeFieldType extends StringFieldType {
257253
}
258254
}
259255
}
260-
this.hasNorms = other.hasNorms;
261256
}
262257

263258
public void setPrefixField(PrefixFieldType prefixField) {
@@ -285,7 +280,7 @@ private ShingleFieldType shingleFieldForPositions(int positions) {
285280

286281
@Override
287282
public Query existsQuery(QueryShardContext context) {
288-
if (hasNorms == false) {
283+
if (getTextSearchInfo().hasNorms() == false) {
289284
return new TermQuery(new Term(FieldNamesFieldMapper.NAME, name()));
290285
} else {
291286
return new NormsFieldExistsQuery(name());
@@ -386,20 +381,18 @@ static final class PrefixFieldType extends StringFieldType {
386381
final int maxChars;
387382
final String parentField;
388383

389-
PrefixFieldType(String parentField, int minChars, int maxChars) {
390-
super(parentField + PREFIX_FIELD_SUFFIX, true, false, Collections.emptyMap());
384+
PrefixFieldType(String parentField, FieldType fieldType, int minChars, int maxChars) {
385+
super(parentField + PREFIX_FIELD_SUFFIX, true, false, new TextSearchInfo(fieldType), Collections.emptyMap());
391386
this.minChars = minChars;
392387
this.maxChars = maxChars;
393388
this.parentField = parentField;
394-
this.hasPositions = true;
395389
}
396390

397391
PrefixFieldType(PrefixFieldType other) {
398392
super(other);
399393
this.minChars = other.minChars;
400394
this.maxChars = other.maxChars;
401395
this.parentField = other.parentField;
402-
this.hasPositions = other.hasPositions;
403396
}
404397

405398
boolean termLengthWithinBounds(int length) {
@@ -539,21 +532,16 @@ protected String contentType() {
539532
*/
540533
static class ShingleFieldType extends StringFieldType {
541534
final int shingleSize;
542-
final boolean hasNorms;
543535
PrefixFieldType prefixFieldType;
544536

545-
ShingleFieldType(String name, int shingleSize, boolean hasNorms) {
546-
super(name, true, false, Collections.emptyMap());
537+
ShingleFieldType(String name, int shingleSize, FieldType fieldType) {
538+
super(name, true, false, new TextSearchInfo(fieldType), Collections.emptyMap());
547539
this.shingleSize = shingleSize;
548-
this.hasNorms = hasNorms;
549-
this.hasPositions = true;
550540
}
551541

552542
ShingleFieldType(ShingleFieldType other) {
553543
super(other);
554544
this.shingleSize = other.shingleSize;
555-
this.hasNorms = other.hasNorms;
556-
this.hasPositions = other.hasPositions;
557545
if (other.prefixFieldType != null) {
558546
this.prefixFieldType = other.prefixFieldType.clone();
559547
}
@@ -575,7 +563,7 @@ public String typeName() {
575563

576564
@Override
577565
public Query existsQuery(QueryShardContext context) {
578-
if (hasNorms == false) {
566+
if (getTextSearchInfo().hasNorms() == false) {
579567
return new TermQuery(new Term(FieldNamesFieldMapper.NAME, name()));
580568
} else {
581569
return new NormsFieldExistsQuery(name());

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
package org.elasticsearch.index.mapper;
2121

22+
import org.apache.lucene.document.FieldType;
23+
import org.apache.lucene.index.IndexOptions;
2224
import org.apache.lucene.index.Term;
2325
import org.apache.lucene.search.ConstantScoreQuery;
2426
import org.apache.lucene.search.PrefixQuery;
@@ -41,12 +43,17 @@
4143
public class SearchAsYouTypeFieldTypeTests extends FieldTypeTestCase<MappedFieldType> {
4244

4345
private static final String NAME = "a_field";
46+
private static final FieldType UNSEARCHABLE = new FieldType();
47+
static {
48+
UNSEARCHABLE.setIndexOptions(IndexOptions.NONE);
49+
UNSEARCHABLE.freeze();
50+
}
4451

4552
@Override
4653
protected SearchAsYouTypeFieldType createDefaultFieldType(String name, Map<String, String> meta) {
47-
final SearchAsYouTypeFieldType fieldType = new SearchAsYouTypeFieldType(name, true, meta, true);
48-
fieldType.setPrefixField(new PrefixFieldType(NAME, Defaults.MIN_GRAM, Defaults.MAX_GRAM));
49-
fieldType.setShingleFields(new ShingleFieldType[] { new ShingleFieldType(fieldType.name(), 2, true) });
54+
final SearchAsYouTypeFieldType fieldType = new SearchAsYouTypeFieldType(name, Defaults.FIELD_TYPE, meta);
55+
fieldType.setPrefixField(new PrefixFieldType(NAME, Defaults.FIELD_TYPE, Defaults.MIN_GRAM, Defaults.MAX_GRAM));
56+
fieldType.setShingleFields(new ShingleFieldType[] { new ShingleFieldType(fieldType.name(), 2, Defaults.FIELD_TYPE) });
5057
return fieldType;
5158
}
5259

@@ -55,7 +62,7 @@ public void testTermQuery() {
5562

5663
assertThat(fieldType.termQuery("foo", null), equalTo(new TermQuery(new Term(NAME, "foo"))));
5764

58-
SearchAsYouTypeFieldType unsearchable = new SearchAsYouTypeFieldType(NAME, false, Collections.emptyMap(), true);
65+
SearchAsYouTypeFieldType unsearchable = new SearchAsYouTypeFieldType(NAME, UNSEARCHABLE, Collections.emptyMap());
5966
final IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> unsearchable.termQuery("foo", null));
6067
assertThat(e.getMessage(), equalTo("Cannot search on field [" + NAME + "] since it is not indexed."));
6168
}
@@ -66,7 +73,7 @@ public void testTermsQuery() {
6673
assertThat(fieldType.termsQuery(asList("foo", "bar"), null),
6774
equalTo(new TermInSetQuery(NAME, asList(new BytesRef("foo"), new BytesRef("bar")))));
6875

69-
SearchAsYouTypeFieldType unsearchable = new SearchAsYouTypeFieldType(NAME, false, Collections.emptyMap(), true);
76+
SearchAsYouTypeFieldType unsearchable = new SearchAsYouTypeFieldType(NAME, UNSEARCHABLE, Collections.emptyMap());
7077
final IllegalArgumentException e =
7178
expectThrows(IllegalArgumentException.class, () -> unsearchable.termsQuery(asList("foo", "bar"), null));
7279
assertThat(e.getMessage(), equalTo("Cannot search on field [" + NAME + "] since it is not indexed."));

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.elasticsearch.index.mapper.FieldMapper;
2929
import org.elasticsearch.index.mapper.ParseContext;
3030
import org.elasticsearch.index.mapper.StringFieldType;
31+
import org.elasticsearch.index.mapper.TextSearchInfo;
3132
import org.elasticsearch.index.query.QueryShardContext;
3233
import org.elasticsearch.search.aggregations.support.CoreValuesSourceType;
3334

@@ -77,7 +78,7 @@ public static class MetaJoinFieldType extends StringFieldType {
7778
private final String joinField;
7879

7980
MetaJoinFieldType(String joinField) {
80-
super(NAME, false, false, Collections.emptyMap());
81+
super(NAME, false, false, TextSearchInfo.SIMPLE_MATCH_ONLY, Collections.emptyMap());
8182
this.joinField = joinField;
8283
}
8384

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import org.elasticsearch.index.mapper.MappedFieldType;
3939
import org.elasticsearch.index.mapper.ParseContext;
4040
import org.elasticsearch.index.mapper.StringFieldType;
41+
import org.elasticsearch.index.mapper.TextSearchInfo;
4142
import org.elasticsearch.index.query.QueryShardContext;
4243
import org.elasticsearch.search.aggregations.support.CoreValuesSourceType;
4344

@@ -94,7 +95,7 @@ public ParentIdFieldMapper build(BuilderContext context) {
9495

9596
public static final class ParentIdFieldType extends StringFieldType {
9697
ParentIdFieldType(String name, boolean eagerGlobalOrdinals, Map<String, String> meta) {
97-
super(name, true, true, meta);
98+
super(name, true, true, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
9899
setIndexAnalyzer(Lucene.KEYWORD_ANALYZER);
99100
setSearchAnalyzer(Lucene.KEYWORD_ANALYZER);
100101
setEagerGlobalOrdinals(eagerGlobalOrdinals);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import org.elasticsearch.index.mapper.MapperService;
4444
import org.elasticsearch.index.mapper.ParseContext;
4545
import org.elasticsearch.index.mapper.StringFieldType;
46+
import org.elasticsearch.index.mapper.TextSearchInfo;
4647
import org.elasticsearch.index.query.QueryShardContext;
4748
import org.elasticsearch.search.aggregations.support.CoreValuesSourceType;
4849

@@ -205,7 +206,7 @@ public Mapper.Builder<?> parse(String name, Map<String, Object> node, ParserCont
205206

206207
public static final class JoinFieldType extends StringFieldType {
207208
public JoinFieldType(String name, Map<String, String> meta) {
208-
super(name, true, true, meta);
209+
super(name, true, true, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
209210
setIndexAnalyzer(Lucene.KEYWORD_ANALYZER);
210211
setSearchAnalyzer(Lucene.KEYWORD_ANALYZER);
211212
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
import org.elasticsearch.index.mapper.ParseContext;
6767
import org.elasticsearch.index.mapper.RangeFieldMapper;
6868
import org.elasticsearch.index.mapper.RangeType;
69+
import org.elasticsearch.index.mapper.TextSearchInfo;
6970
import org.elasticsearch.index.query.BoolQueryBuilder;
7071
import org.elasticsearch.index.query.BoostingQueryBuilder;
7172
import org.elasticsearch.index.query.ConstantScoreQueryBuilder;
@@ -198,7 +199,7 @@ static class PercolatorFieldType extends MappedFieldType {
198199
boolean mapUnmappedFieldsAsText;
199200

200201
PercolatorFieldType(String name, Map<String, String> meta) {
201-
super(name, false, false, meta);
202+
super(name, false, false, TextSearchInfo.NONE, meta);
202203
}
203204

204205
PercolatorFieldType(PercolatorFieldType ref) {

plugins/analysis-icu/src/main/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static final class CollationFieldType extends StringFieldType {
7777
private final Collator collator;
7878

7979
public CollationFieldType(String name, boolean isSearchable, boolean hasDocValues, Collator collator, Map<String, String> meta) {
80-
super(name, isSearchable, hasDocValues, meta);
80+
super(name, isSearchable, hasDocValues, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
8181
setIndexAnalyzer(Lucene.KEYWORD_ANALYZER);
8282
setSearchAnalyzer(Lucene.KEYWORD_ANALYZER);
8383
this.collator = collator;

plugins/mapper-annotated-text/src/main/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private AnnotatedTextFieldType buildFieldType(BuilderContext context) {
124124
} else {
125125
//Using the analyzer's default BUT need to do the same thing AnalysisRegistry.processAnalyzerFactory
126126
// does to splice in new default of posIncGap=100 by wrapping the analyzer
127-
if (fieldType.indexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0) {
127+
if (hasPositions) {
128128
int overrideInc = TextFieldMapper.Defaults.POSITION_INCREMENT_GAP;
129129
ft.setIndexAnalyzer(indexAnalyzer, overrideInc);
130130
ft.setSearchAnalyzer(new NamedAnalyzer(searchAnalyzer, overrideInc));
@@ -522,7 +522,7 @@ private void emitAnnotation(int firstSpannedTextPosInc, int annotationPosLen) th
522522
public static final class AnnotatedTextFieldType extends TextFieldMapper.TextFieldType {
523523

524524
public AnnotatedTextFieldType(String name, boolean hasPositions, Map<String, String> meta) {
525-
super(name, true, hasPositions, meta);
525+
super(name, hasPositions, meta);
526526
}
527527

528528
protected AnnotatedTextFieldType(AnnotatedTextFieldType ref) {

plugins/mapper-murmur3/src/main/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.elasticsearch.index.mapper.Mapper;
3636
import org.elasticsearch.index.mapper.MapperParsingException;
3737
import org.elasticsearch.index.mapper.ParseContext;
38+
import org.elasticsearch.index.mapper.TextSearchInfo;
3839
import org.elasticsearch.index.mapper.TypeParsers;
3940
import org.elasticsearch.index.query.QueryShardContext;
4041
import org.elasticsearch.index.query.QueryShardException;
@@ -92,7 +93,7 @@ public Mapper.Builder<?> parse(String name, Map<String, Object> node, ParserCont
9293
// this only exists so a check can be done to match the field type to using murmur3 hashing...
9394
public static class Murmur3FieldType extends MappedFieldType {
9495
public Murmur3FieldType(String name, Map<String, String> meta) {
95-
super(name, false, true, meta);
96+
super(name, false, true, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
9697
}
9798

9899
protected Murmur3FieldType(Murmur3FieldType ref) {

server/src/main/java/org/elasticsearch/index/fielddata/plain/StringBinaryDVLeafFieldData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.apache.lucene.index.BinaryDocValues;
2323
import org.elasticsearch.index.fielddata.ScriptDocValues;
2424

25-
final class StringBinaryDVLeafFieldData extends AbstractBinaryDVLeafFieldData{
25+
final class StringBinaryDVLeafFieldData extends AbstractBinaryDVLeafFieldData {
2626
StringBinaryDVLeafFieldData(BinaryDocValues values) {
2727
super(values);
2828
}
@@ -31,4 +31,4 @@ final class StringBinaryDVLeafFieldData extends AbstractBinaryDVLeafFieldData{
3131
public ScriptDocValues<String> getScriptValues() {
3232
return new ScriptDocValues.Strings(getBytesValues());
3333
}
34-
}
34+
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ public T parse(String name, Map<String, Object> node, Map<String, Object> params
172172
}
173173

174174
@Override
175-
@SuppressWarnings("rawtypes")
176175
public T parse(String name, Map<String, Object> node, ParserContext parserContext)
177176
throws MapperParsingException {
178177
Map<String, Object> params = new HashMap<>();
@@ -186,7 +185,7 @@ public abstract static class AbstractGeometryFieldType<Parsed, Processed> extend
186185
protected QueryProcessor geometryQueryBuilder;
187186

188187
protected AbstractGeometryFieldType(String name, boolean indexed, boolean hasDocValues, Map<String, String> meta) {
189-
super(name, indexed, hasDocValues, meta);
188+
super(name, indexed, hasDocValues, TextSearchInfo.SIMPLE_MATCH_ONLY, meta);
190189
}
191190

192191
protected AbstractGeometryFieldType(AbstractGeometryFieldType ref) {

0 commit comments

Comments
 (0)