# Field names with '.' vs. object data type hierarchy

**URL:** <https://discuss.elastic.co/t/field-names-with-vs-object-data-type-hierarchy/94941>\
**Category:** Elasticsearch\
**Created:** [July 28, 2017, 11:14am UTC](https://discuss.elastic.co/t/field-names-with-vs-object-data-type-hierarchy/94941 "2017-07-28T11:14:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![earl.lapus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/earl.lapus/32/20397_2.png) [@earl.lapus](https://discuss.elastic.co/u/earl.lapus)\
**Post date:** [July 28, 2017, 11:14am UTC](https://discuss.elastic.co/t/field-names-with-vs-object-data-type-hierarchy/94941/1 "2017-07-28T11:14:41Z")

</div>

Object data type hierarchy is expressed by putting '.' characters between object names, as described [here](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/object.html)

I was wondering how this would affect fields in a document that have '.' characters between them but are not meant to be interpreted as hierarchical objects... just plain strings.

Example:  
{  
"time.out": 100  
}

1. Is it recommended to avoid fields with '.' characters?
2. Is it possible to define a mapping template for my document that can distinguish between field names that ought to be interpreted as objects from those that must be interpreted as plain strings? - perhaps the regex option described [here](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/dynamic-templates.html) is a path I should take.

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [August 9, 2017, 1:37am UTC](https://discuss.elastic.co/t/field-names-with-vs-object-data-type-hierarchy/94941/2 "2017-08-09T01:37:25Z")

</div>

Dots are always object hierarchy separators. There is no way to distinguish. In the case of "time.out", an object field call "time" would be created, with a subfield called "out" which is an `int`.

---

<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:** [September 6, 2017, 1:37am UTC](https://discuss.elastic.co/t/field-names-with-vs-object-data-type-hierarchy/94941/3 "2017-09-06T01:37:28Z")

</div>

Closed on September 6, 2017, 1:37am UTC

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