diff --git a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/FeatureFieldMapper.java b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/FeatureFieldMapper.java index 5b0158ff55b..30e18ae6d68 100644 --- a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/FeatureFieldMapper.java +++ b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/FeatureFieldMapper.java @@ -163,14 +163,6 @@ public class FeatureFieldMapper extends FieldMapper { return new TermQuery(new Term("_feature", name())); } - @Override - public Query nullValueQuery() { - if (nullValue() == null) { - return null; - } - return termQuery(nullValue(), null); - } - @Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { failIfNoDocValues(); diff --git a/plugins/analysis-icu/src/main/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapper.java b/plugins/analysis-icu/src/main/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapper.java index a4502a953db..c4c44222f47 100644 --- a/plugins/analysis-icu/src/main/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapper.java +++ b/plugins/analysis-icu/src/main/java/org/elasticsearch/index/mapper/ICUCollationKeywordFieldMapper.java @@ -135,14 +135,6 @@ public class ICUCollationKeywordFieldMapper extends FieldMapper { } } - @Override - public Query nullValueQuery() { - if (nullValue() == null) { - return null; - } - return termQuery(nullValue(), null); - } - @Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { failIfNoDocValues(); diff --git a/server/src/main/java/org/apache/lucene/queries/ExtendedCommonTermsQuery.java b/server/src/main/java/org/apache/lucene/queries/ExtendedCommonTermsQuery.java index c0c6bbb05d8..249b7fa83b5 100644 --- a/server/src/main/java/org/apache/lucene/queries/ExtendedCommonTermsQuery.java +++ b/server/src/main/java/org/apache/lucene/queries/ExtendedCommonTermsQuery.java @@ -19,12 +19,8 @@ package org.apache.lucene.queries; -import org.apache.lucene.index.Term; -import org.apache.lucene.index.TermContext; import org.apache.lucene.search.BooleanClause.Occur; -import org.apache.lucene.search.Query; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.index.mapper.MappedFieldType; /** * Extended version of {@link CommonTermsQuery} that allows to pass in a @@ -33,11 +29,8 @@ import org.elasticsearch.index.mapper.MappedFieldType; */ public class ExtendedCommonTermsQuery extends CommonTermsQuery { - private final MappedFieldType fieldType; - - public ExtendedCommonTermsQuery(Occur highFreqOccur, Occur lowFreqOccur, float maxTermFrequency, MappedFieldType fieldType) { + public ExtendedCommonTermsQuery(Occur highFreqOccur, Occur lowFreqOccur, float maxTermFrequency) { super(highFreqOccur, lowFreqOccur, maxTermFrequency); - this.fieldType = fieldType; } private String lowFreqMinNumShouldMatchSpec; @@ -80,16 +73,4 @@ public class ExtendedCommonTermsQuery extends CommonTermsQuery { return this.maxTermFrequency; } - @Override - protected Query newTermQuery(Term term, TermContext context) { - if (fieldType == null) { - return super.newTermQuery(term, context); - } - final Query query = fieldType.queryStringTermQuery(term); - if (query == null) { - return super.newTermQuery(term, context); - } else { - return query; - } - } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java index 76163929e68..8c3a0923d1d 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java @@ -223,14 +223,6 @@ public final class KeywordFieldMapper extends FieldMapper { } } - @Override - public Query nullValueQuery() { - if (nullValue() == null) { - return null; - } - return termQuery(nullValue(), null); - } - @Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { failIfNoDocValues(); diff --git a/server/src/main/java/org/elasticsearch/index/mapper/MappedFieldType.java b/server/src/main/java/org/elasticsearch/index/mapper/MappedFieldType.java index fb92c576e01..facf669cb5d 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/MappedFieldType.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/MappedFieldType.java @@ -351,13 +351,6 @@ public abstract class MappedFieldType extends FieldType { throw new QueryShardException(context, "Can only use regexp queries on keyword and text fields - not on [" + name + "] which is of type [" + typeName() + "]"); } - public Query nullValueQuery() { - if (nullValue == null) { - return null; - } - return new ConstantScoreQuery(termQuery(nullValue, null)); - } - public abstract Query existsQuery(QueryShardContext context); /** @@ -382,12 +375,6 @@ public abstract class MappedFieldType extends FieldType { return Relation.INTERSECTS; } - /** A term query to use when parsing a query string. Can return {@code null}. */ - @Nullable - public Query queryStringTermQuery(Term term) { - return null; - } - /** @throws IllegalArgumentException if the fielddata is not supported on this type. * An IllegalArgumentException is needed in order to return an http error 400 * when this error occurs in a request. see: {@link org.elasticsearch.ExceptionsHelper#status} diff --git a/server/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java index d71d2ad579c..b5e15f1a026 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java @@ -24,7 +24,6 @@ import org.apache.lucene.analysis.AnalyzerWrapper; import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.ngram.EdgeNGramTokenFilter; import org.apache.lucene.document.Field; -import org.apache.lucene.document.FieldType; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexableField; import org.apache.lucene.index.Term; @@ -471,14 +470,6 @@ public class TextFieldMapper extends FieldMapper { } } - @Override - public Query nullValueQuery() { - if (nullValue() == null) { - return null; - } - return termQuery(nullValue(), null); - } - @Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName) { if (fielddata == false) { diff --git a/server/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java index 974466a3161..2fd4d710f96 100644 --- a/server/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java @@ -371,8 +371,7 @@ public class CommonTermsQueryBuilder extends AbstractQueryBuilder