From fa5a78d2c288c5188ecc2a9a8e8a3598b6132911 Mon Sep 17 00:00:00 2001 From: Suraj Singh Date: Tue, 22 Mar 2022 14:40:42 -0700 Subject: [PATCH] [Type removal] Remove deprecation warning on use of _type in doc scripts Signed-off-by: Suraj Singh --- .../java/org/opensearch/search/lookup/LeafDocLookup.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java b/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java index 82daa94d92146..716476101ac48 100644 --- a/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java @@ -33,7 +33,6 @@ import org.apache.lucene.index.LeafReaderContext; import org.opensearch.ExceptionsHelper; -import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.index.fielddata.IndexFieldData; import org.opensearch.index.fielddata.ScriptDocValues; import org.opensearch.index.mapper.MappedFieldType; @@ -50,10 +49,6 @@ public class LeafDocLookup implements Map> { - private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(LeafDocLookup.class); - static final String TYPES_DEPRECATION_KEY = "type-field-doc-lookup"; - static final String TYPES_DEPRECATION_MESSAGE = "[types removal] Looking up doc types [_type] in scripts is deprecated."; - private final Map> localCacheFieldData = new HashMap<>(4); private final MapperService mapperService; @@ -78,10 +73,6 @@ public void setDocument(int docId) { @Override public ScriptDocValues get(Object key) { - // deprecate _type - if ("_type".equals(key)) { - DEPRECATION_LOGGER.deprecate(TYPES_DEPRECATION_KEY, TYPES_DEPRECATION_MESSAGE); - } // assume its a string... String fieldName = key.toString(); ScriptDocValues scriptValues = localCacheFieldData.get(fieldName);