From 5ddea03de77ba923a0a175b0880a0779e6755f58 Mon Sep 17 00:00:00 2001 From: Luca Cavanna Date: Tue, 16 Jun 2020 00:19:12 +0200 Subject: [PATCH] Remove needless termsQuery implementation from StringFieldType (#57609) The base class `TermBasedFieldType` already implements exactly the same `termsQuery` method, hence there is no need to override it. --- .../elasticsearch/index/mapper/StringFieldType.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/index/mapper/StringFieldType.java b/server/src/main/java/org/elasticsearch/index/mapper/StringFieldType.java index 3b79f54c7b2..dac05567f92 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/StringFieldType.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/StringFieldType.java @@ -26,7 +26,6 @@ import org.apache.lucene.search.MultiTermQuery; import org.apache.lucene.search.PrefixQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.RegexpQuery; -import org.apache.lucene.search.TermInSetQuery; import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.util.BytesRef; @@ -37,7 +36,6 @@ import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.query.support.QueryParsers; -import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -60,16 +58,6 @@ public abstract class StringFieldType extends TermBasedFieldType { super(ref); } - @Override - public Query termsQuery(List values, QueryShardContext context) { - failIfNotIndexed(); - BytesRef[] bytesRefs = new BytesRef[values.size()]; - for (int i = 0; i < bytesRefs.length; i++) { - bytesRefs[i] = indexedValueForSearch(values.get(i)); - } - return new TermInSetQuery(name(), bytesRefs); - } - @Override public Query fuzzyQuery(Object value, Fuzziness fuzziness, int prefixLength, int maxExpansions, boolean transpositions, QueryShardContext context) {