# "name cannot be empty string" error if field name starts with

**URL:** https://discuss.elastic.co/t/name-cannot-be-empty-string-error-if-field-name-starts-with/66808
**Category:** Elasticsearch
**Created:** [November 22, 2016, 2:27am UTC](https://discuss.elastic.co/t/name-cannot-be-empty-string-error-if-field-name-starts-with/66808 "2016-11-22T02:27:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![wyukawa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wyukawa/32/13336_2.png) [@wyukawa](https://discuss.elastic.co/u/wyukawa)
#### Post date: [November 22, 2016, 2:27am UTC](https://discuss.elastic.co/t/name-cannot-be-empty-string-error-if-field-name-starts-with/66808/1 "2016-11-22T02:27:41Z")

</div>

Although Elasticsearch 5 allows dots-in-field-names, the following error occured.

Is this spec or bug?

```
# curl -XPUT 'localhost:9200/twitter/tweet/1?pretty' -d'
> {
> ".a" : "a"
> }
> '
{
  "error" : {
    "root_cause" : [
      {
        "type" : "mapper_parsing_exception",
        "reason" : "failed to parse"
      }
    ],
    "type" : "mapper_parsing_exception",
    "reason" : "failed to parse",
    "caused_by" : {
      "type" : "illegal_argument_exception",
      "reason" : "name cannot be empty string"
    }
  },
  "status" : 400
}

```

\*Elasticsearch version  
5.0.1

\*JVM version  
1.8.0\_102

\*OS version  
CentOS 7.2

---

<div class="post-metadata">

### Author: ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)
#### Post date: [November 22, 2016, 11:10am UTC](https://discuss.elastic.co/t/name-cannot-be-empty-string-error-if-field-name-starts-with/66808/2 "2016-11-22T11:10:46Z")

</div>

From the discussion here:

> <https://github.com/elastic/elasticsearch/issues/15951>

This looks like a side-effect of how dots in field names were implemented.

What's your exact use-case that's causing this issue?

---

<div class="post-metadata">

### Author: ![wyukawa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wyukawa/32/13336_2.png) [@wyukawa](https://discuss.elastic.co/u/wyukawa)
#### Post date: [November 22, 2016, 3:32pm UTC](https://discuss.elastic.co/t/name-cannot-be-empty-string-error-if-field-name-starts-with/66808/3 "2016-11-22T15:32:39Z")

</div>

In my use-case, our users freely send logs through fluentd.  
So, this problem occurs.  
But, I think that users can change field name.

---

<div class="post-metadata">

### Author: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [November 22, 2016, 3:49pm UTC](https://discuss.elastic.co/t/name-cannot-be-empty-string-error-if-field-name-starts-with/66808/4 "2016-11-22T15:49:36Z")

</div>

> [@wyukawa](#):
>
> In my use-case, our users freely send logs through fluentd.

This is slightly dangerous as a use case, I think.

Elasticsearch is generally fine with having lots of fields. Some features, like doc\_values don't do well with sparse fields. If you disable doc\_values on most fields (so no aggregation or sorting on them) then you are generally ok with sparse fields. But each field does have a non-trivial overhead. And adding new fields on the fly requests a cluster state update which can be time consuming. Having thousands of fields in an index doesn't tend to work well.

---

<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, 3:49pm UTC](https://discuss.elastic.co/t/name-cannot-be-empty-string-error-if-field-name-starts-with/66808/5 "2016-12-20T15:49:35Z")

</div>

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