# How to configure index template with more then one analyzer?

**URL:** <https://discuss.elastic.co/t/how-to-configure-index-template-with-more-then-one-analyzer/66867>\
**Category:** Elasticsearch\
**Created:** [November 22, 2016, 2:30pm UTC](https://discuss.elastic.co/t/how-to-configure-index-template-with-more-then-one-analyzer/66867 "2016-11-22T14:30:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rudolf\_Reddy\_Macejka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rudolf_reddy_macejka/32/12875_2.png) [@Rudolf\_Reddy\_Macejka](https://discuss.elastic.co/u/Rudolf_Reddy_Macejka)\
**Post date:** [November 22, 2016, 2:30pm UTC](https://discuss.elastic.co/t/how-to-configure-index-template-with-more-then-one-analyzer/66867/1 "2016-11-22T14:30:41Z")

</div>

Hello,

I am trying to define index template where by default will be "whitespace" tokenizer but for a few fields I would like to specify "keyword" indexing.  
I have tried following

```
POST /tracking-2016.11.*/_close
PUT /tracking-2016.11.*/_settings
{ "analysis": {
      "analyzer": {
        "default": {
           "type": "custom",
           "filter": ["lowercase"],
           "tokenizer": "whitespace",
           "fields": {
             "sourcesystem": {
               "type": "string",
               "tokenizer": "keyword"
             },
             "idmastermessage": {
               "type": "string",
               "tokenizer": "keyword"
             },
             "idsourcemessage": {
               "type": "string",
               "tokenizer": "keyword"
             }
           }
        }
      }
    }
}

POST /tracking-2016.11.*/_open
POST /tracking-2016.11.*/_refresh

```

but even if it didn't reported any error the **sourcesystem** is still returning values tokenized by space. Full value should be EMEA DCG UAT. Field **pairing** is tokenized properly:

```
  "aggregations": {
    "sourcesystem": {
      "doc_count_error_upper_bound": 0,
      "sum_other_doc_count": 0,
      "buckets": [
        {
          "key": "dcg",
          "doc_count": 8,
          "pairing": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 1,
            "buckets": [
              {
                "key": "000000000551652269",
                "doc_count": 8
              },
              {
                "key": "00000551652270",
                "doc_count": 8
              },
              {
                "key": "ci1479806967810.5904183@czcholsint372_te",
                "doc_count": 8
              },

```

I didn't found any such way in documentation but tried combination of googling and attempt-fail methods.

Do you have somebody any experience with the combinations of analyzes?

Thanks in advance,  
Cheers, Reddy

---

<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:** [December 20, 2016, 2:30pm UTC](https://discuss.elastic.co/t/how-to-configure-index-template-with-more-then-one-analyzer/66867/2 "2016-12-20T14:30:54Z")

</div>

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