# Why this！！！(one field two types)

**URL:** https://discuss.elastic.co/t/why-this-one-field-two-types/77097
**Category:** Elasticsearch
**Created:** [March 2, 2017, 6:52am UTC](https://discuss.elastic.co/t/why-this-one-field-two-types/77097 "2017-03-02T06:52:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Super\_L](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@Super\_L](https://discuss.elastic.co/u/Super_L)
#### Post date: [March 2, 2017, 6:52am UTC](https://discuss.elastic.co/t/why-this-one-field-two-types/77097/1 "2017-03-02T06:52:32Z")

</div>

Hi all  
I create a index by index template, the mapping as following:

```json
{
    "template" : "logstash-bmwrtti-*",
    "settings" : {
        "index.refresh_interval" : "5s",
        "analysis" : {
            "tokenizer" : {
                "url_tokenizer" : {
                    "type" : "pattern",
                    "pattern" : "&"
                }
            },
            "analyzer" : {
                "url_analyzer" : {
                    "type" : "custom",
                    "tokenizer" : "url_tokenizer",
                    "filter" : ["lowercase"]
                }
            }
        }
    },
    "mappings" : {
        "_default_" : {
        	"_all": { 
                "enabled": false
            },
            "properties" : {
                "rowkey" : {
                    "type" : "text"
                },
                "dirveid" : {
                    "type" : "keyword"
                },
                "uri" : {
                    "type" : "text",
                    "analyzer" : "url_analyzer"
                },
                "reqtime" : {
                    "type" : "date",
                    "format" : "epoch_millis"
                },
                "restime" : {
                    "type" : "date",
                    "format" : "epoch_millis"
                },
                "answertime" : {
                    "type" : "integer"
                },
                "serverip" : {
                    "type" : "ip"
                },
                "adcode" : {
                    "type" : "keyword"
                },
                "ccplonlat" : {
                    "type" : "geo_point"
                },
                "deslonlat" : {
                    "type" : "geo_point"
                },
                "cversion" : {
                    "type" : "keyword"
                },
                "dversion" : {
                    "type" : "keyword"
                },
                "responsesize" : {
                    "type" : "integer"
                },
                "datatype" : {
                    "type" : "keyword"
                }
            }
        }
    }
}

```

And then , I get this mapping , response part as following:

```json
"dirveid": {
       "type": "keyword"
  },
  "driveid": {
       "type": "text",
          "fields": {
            "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
   }

```

Why this ? Pls help~

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [March 2, 2017, 7:10am UTC](https://discuss.elastic.co/t/why-this-one-field-two-types/77097/2 "2017-03-02T07:10:30Z")

</div>

You have two distinct fields, `'driveid'` and `'dirveid'` (incorrect spelling?).`'dirveid'` exists in your mapping, but `'driveid'` does not, and therefore appears to have been assigned default mapping.

---

<div class="post-metadata">

### Author: ![Super\_L](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@Super\_L](https://discuss.elastic.co/u/Super_L)
#### Post date: [March 2, 2017, 7:13am UTC](https://discuss.elastic.co/t/why-this-one-field-two-types/77097/3 "2017-03-02T07:13:18Z")

</div>

😰  
how stupid ！！！ Thx

---

<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: [March 30, 2017, 7:13am UTC](https://discuss.elastic.co/t/why-this-one-field-two-types/77097/4 "2017-03-30T07:13:21Z")

</div>

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