Skip to content

Commit 83a99ff

Browse files
committed
Remove MappedFieldType#nullValueQuery, as it is now unused.
1 parent d826cb3 commit 83a99ff

File tree

6 files changed

+1
-49
lines changed

6 files changed

+1
-49
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,6 @@ public Query existsQuery(QueryShardContext context) {
163163
return new TermQuery(new Term("_feature", name()));
164164
}
165165

166-
@Override
167-
public Query nullValueQuery() {
168-
if (nullValue() == null) {
169-
return null;
170-
}
171-
return termQuery(nullValue(), null);
172-
}
173-
174166
@Override
175167
public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) {
176168
failIfNoDocValues();

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,6 @@ public Query existsQuery(QueryShardContext context) {
135135
}
136136
}
137137

138-
@Override
139-
public Query nullValueQuery() {
140-
if (nullValue() == null) {
141-
return null;
142-
}
143-
return termQuery(nullValue(), null);
144-
}
145-
146138
@Override
147139
public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) {
148140
failIfNoDocValues();

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,6 @@ public Query existsQuery(QueryShardContext context) {
223223
}
224224
}
225225

226-
@Override
227-
public Query nullValueQuery() {
228-
if (nullValue() == null) {
229-
return null;
230-
}
231-
return termQuery(nullValue(), null);
232-
}
233-
234226
@Override
235227
public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) {
236228
failIfNoDocValues();

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,13 +351,6 @@ public Query regexpQuery(String value, int flags, int maxDeterminizedStates, @Nu
351351
throw new QueryShardException(context, "Can only use regexp queries on keyword and text fields - not on [" + name + "] which is of type [" + typeName() + "]");
352352
}
353353

354-
public Query nullValueQuery() {
355-
if (nullValue == null) {
356-
return null;
357-
}
358-
return new ConstantScoreQuery(termQuery(nullValue, null));
359-
}
360-
361354
public abstract Query existsQuery(QueryShardContext context);
362355

363356
/**

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.apache.lucene.analysis.TokenFilter;
2525
import org.apache.lucene.analysis.ngram.EdgeNGramTokenFilter;
2626
import org.apache.lucene.document.Field;
27-
import org.apache.lucene.document.FieldType;
2827
import org.apache.lucene.index.IndexOptions;
2928
import org.apache.lucene.index.IndexableField;
3029
import org.apache.lucene.index.Term;
@@ -471,14 +470,6 @@ public Query existsQuery(QueryShardContext context) {
471470
}
472471
}
473472

474-
@Override
475-
public Query nullValueQuery() {
476-
if (nullValue() == null) {
477-
return null;
478-
}
479-
return termQuery(nullValue(), null);
480-
}
481-
482473
@Override
483474
public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) {
484475
if (fielddata == false) {

server/src/test/java/org/elasticsearch/index/mapper/FakeStringFieldMapper.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,6 @@ public String typeName() {
105105
return CONTENT_TYPE;
106106
}
107107

108-
@Override
109-
public Query nullValueQuery() {
110-
if (nullValue() == null) {
111-
return null;
112-
}
113-
return termQuery(nullValue(), null);
114-
}
115-
116108
@Override
117109
public Query existsQuery(QueryShardContext context) {
118110
if (hasDocValues()) {
@@ -136,7 +128,7 @@ protected void parseCreateField(ParseContext context, List<IndexableField> field
136128
} else {
137129
value = context.parser().textOrNull();
138130
}
139-
131+
140132
if (value == null) {
141133
return;
142134
}

0 commit comments

Comments
 (0)