# Need help to understand one template

**URL:** <https://discuss.elastic.co/t/need-help-to-understand-one-template/160708>\
**Category:** Logstash\
**Created:** [December 13, 2018, 10:21am UTC](https://discuss.elastic.co/t/need-help-to-understand-one-template/160708 "2018-12-13T10:21:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![inandi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inandi/32/40801_2.png) [@inandi](https://discuss.elastic.co/u/inandi)\
**Post date:** [December 13, 2018, 10:21am UTC](https://discuss.elastic.co/t/need-help-to-understand-one-template/160708/1 "2018-12-13T10:21:06Z")

</div>

i have this template for indexing data. It was written before.

```
{
  "data_tamplate": {
    "mappings": {
      "dynamic": "false",
      "properties": {
        "rollnumber": {
          "type": "text",
          "fields": {
            "raw": {
              "type": "keyword"
            }
          }
        }
      }
    }
  }
}

```

I am confused about **rollnumber** structure. It is text or keyword. hwo does it effect on search using **rollnumber** key?

---

<div class="post-metadata">

**Author:** ![admlko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/admlko/32/21787_2.png) [@admlko](https://discuss.elastic.co/u/admlko)\
**Post date:** [December 13, 2018, 11:49am UTC](https://discuss.elastic.co/t/need-help-to-understand-one-template/160708/2 "2018-12-13T11:49:57Z")

</div>

The "rollnumber" field type is text, but it also has a field which is called "raw" and that is a keyword.  
So if you want to use the "rollnumber" field for full text search, use it, and if you want to use it within visualizations and aggregations, use "rollnumber.raw", because it is a keyword.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html#\_multi\_fields](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html#_multi_fields)

---

<div class="post-metadata">

**Author:** ![inandi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inandi/32/40801_2.png) [@inandi](https://discuss.elastic.co/u/inandi)\
**Post date:** [December 13, 2018, 11:55am UTC](https://discuss.elastic.co/t/need-help-to-understand-one-template/160708/3 "2018-12-13T11:55:48Z")

</div>

thanks long live @admlko

---

<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:** [January 10, 2019, 11:55am UTC](https://discuss.elastic.co/t/need-help-to-understand-one-template/160708/4 "2019-01-10T11:55:51Z")

</div>

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