# Transform creating field as keyword instead of text

**URL:** <https://discuss.elastic.co/t/transform-creating-field-as-keyword-instead-of-text/227183>\
**Category:** Kibana\
**Created:** [April 8, 2020, 5:09pm UTC](https://discuss.elastic.co/t/transform-creating-field-as-keyword-instead-of-text/227183 "2020-04-08T17:09:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kernsb](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@kernsb](https://discuss.elastic.co/u/kernsb)\
**Post date:** [April 8, 2020, 5:09pm UTC](https://discuss.elastic.co/t/transform-creating-field-as-keyword-instead-of-text/227183/1 "2020-04-08T17:09:23Z")

</div>

So I have created two Transforms that have a common field of "computer\_name", but when creating them one maps the field as text, with a sub keyword field, while the other marks the top field as keyword.

I have created an index template for the latter set as

```auto
      "computer_name": {
        "type": "text",
        "fields": {
          "keyword": {
            "ignore_above": 256,
            "type": "keyword"
          }
        }
      },

```

But on re-creating the transform and index, it is still coming in with 'computer\_name' as keyword, ignoring the template.

I need the two to behave the same in searches, so I need for them to match each other. Any advice?

---

<div class="post-metadata">

**Author:** ![Hendrik\_Muhs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hendrik_muhs/32/25802_2.png) [@Hendrik\_Muhs](https://discuss.elastic.co/u/Hendrik_Muhs)\
**Post date:** [April 9, 2020, 5:27am UTC](https://discuss.elastic.co/t/transform-creating-field-as-keyword-instead-of-text/227183/2 "2020-04-09T05:27:11Z")

</div>

Hi,

to customize mappings:

- create the transform job _without_ starting it
- create the destination index (note that the `_preview` endpoint returns the result of mapping deduction, which you can use as template)
- start the transform

---

<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:** [May 7, 2020, 5:27am UTC](https://discuss.elastic.co/t/transform-creating-field-as-keyword-instead-of-text/227183/3 "2020-05-07T05:27:20Z")

</div>

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