# Dynamic Mapping keyword over text without path\_match

**URL:** <https://discuss.elastic.co/t/dynamic-mapping-keyword-over-text-without-path-match/123307>\
**Category:** Elasticsearch\
**Created:** [March 9, 2018, 5:02pm UTC](https://discuss.elastic.co/t/dynamic-mapping-keyword-over-text-without-path-match/123307 "2018-03-09T17:02:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![philv](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@philv](https://discuss.elastic.co/u/philv)\
**Post date:** [March 9, 2018, 5:02pm UTC](https://discuss.elastic.co/t/dynamic-mapping-keyword-over-text-without-path-match/123307/1 "2018-03-09T17:02:26Z")

</div>

Is there a way to force a field to be a 'keyword' type as opposed to a 'text' type without relying on the field name and path\_matching ?

I don't know which field names I'll be indexing, but I'd like to be able to submit some type information along with these to specify either keyword or text.

I could manipulate my fieldname to use a path\_match in a dynamic template, eg.

```
 "dynamic_templates": [
    {
  "keywords": {
    "path_match": "*_k_",
    "mapping": {
      "type": "keyword"
    }
  }
}

```

....

would correctly identify a field named: myfield\_k\_ as a keyword field. but then I'd want the field to be stored as 'myfield' without the _k_ appendage.

I don't think index time renaming is possible, but I thought I'd check.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 6, 2018, 5:02pm UTC](https://discuss.elastic.co/t/dynamic-mapping-keyword-over-text-without-path-match/123307/2 "2018-04-06T17:02:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
