Skip to content

Commit

Permalink
[Type removal] Remove deprecation warning on use of _type in doc scri…
Browse files Browse the repository at this point in the history
…pts (#2564)

Signed-off-by: Suraj Singh <surajrider@gmail.com>
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
(cherry picked from commit c1d5491)
  • Loading branch information
dreamer-89 authored and nknize committed Mar 24, 2022
1 parent 3d20c89 commit 023a4db
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -50,10 +49,6 @@

public class LeafDocLookup implements Map<String, ScriptDocValues<?>> {

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<String, ScriptDocValues<?>> localCacheFieldData = new HashMap<>(4);

private final MapperService mapperService;
Expand All @@ -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);
Expand Down

0 comments on commit 023a4db

Please sign in to comment.