### Description

### Description

The _terms_enum API [currently supports](https://github.com/elastic/elasticsearch/pull/83244) keyword, constant_keyword and flattened fields. 

Kibana would also like to support `ip` field type: https://github.com/elastic/kibana/issues/140266
Opening this issue to discuss if this is possible. 

I tried to workaround this limitation in Kibana using terms_agg for suggestions, but this also didn't work: 
https://github.com/elastic/kibana/issues/140266#issuecomment-1240828371



Note: there is a similar issue and some progress on _version_ type: https://github.com/elastic/elasticsearch/issues/83403



server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java
import org.elasticsearch.script.ScriptCompiler;
import org.elasticsearch.script.SortedSetDocValuesStringFieldScript;
import org.elasticsearch.script.StringFieldScript;
import org.elasticsearch.script.field.KeywordDocValuesField;
import org.elasticsearch.search.aggregations.support.CoreValuesSourceType;
import org.elasticsearch.search.lookup.FieldValues;
import org.elasticsearch.search.lookup.SearchLookup;
import org.elasticsearch.search.runtime.StringScriptFieldFuzzyQuery;
import org.elasticsearch.search.runtime.StringScriptFieldPrefixQuery;
import org.elasticsearch.search.runtime.StringScriptFieldRegexpQuery;
import org.elasticsearch.search.runtime.StringScriptFieldTermQuery;
import org.elasticsearch.search.runtime.StringScriptFieldWildcardQuery;
import org.elasticsearch.xcontent.XContentBuilder;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import static org.apache.lucene.index.IndexWriter.MAX_TERM_LENGTH;
import static org.elasticsearch.core.Strings.format;
/**
 * A field mapper for keywords. This mapper accepts strings and indexes them as-is.
 */
public final class KeywordFieldMapper extends FieldMapper {