# Escaping dots

**URL:** <https://discuss.elastic.co/t/escaping-dots/95892>\
**Category:** Elasticsearch\
**Created:** [August 4, 2017, 2:02pm UTC](https://discuss.elastic.co/t/escaping-dots/95892 "2017-08-04T14:02:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruno.teixeira](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@bruno.teixeira](https://discuss.elastic.co/u/bruno.teixeira)\
**Post date:** [August 4, 2017, 2:02pm UTC](https://discuss.elastic.co/t/escaping-dots/95892/1 "2017-08-04T14:02:34Z")

</div>

Hello guyz,

I'm trying to map a dynamic dictionary and i'm having problems with some keys.  
Picture this example.

"systemvariables":{  
"windows.user.home":"C:\Users\someuser",  
"windows.user.home.desktop":"C:\Users\someuser\Desktop",  
"windows.user.home.document":"C:\Users\someuser\Documents"  
}

I get this error "Can't merge a non object mapping [buildvariables.windows.user.home] with an object mapping [buildvariables.windows.user.home]" because Elasticsearch is spliting my keys by the dots and indexing them hierarchically.

Meaning the first key:value pair is index as "text" but the second is mapped as an "object".

Is there a way to disable this behavior? Or a way to escape the dot character instead of a simple replace for "\_"?

Thanks,

---

<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 4, 2017, 11:02pm UTC](https://discuss.elastic.co/t/escaping-dots/95892/2 "2017-08-04T23:02:18Z")

</div>

Dots are special syntax in field names. They represent hiearchy within the json data of the document. So `windows.user.home` is an object field called `windows`, containing an object field called `user`, containing a string field called `home`. When you then add `windows.user.home.desktop`, it expects `windows.user.home` to be an object field, but you already have it mapped as a string.

In your case the best thing to do is replace dot with some other character, like underscore as you suggested.

---

<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 1, 2017, 11:05pm UTC](https://discuss.elastic.co/t/escaping-dots/95892/3 "2017-09-01T23:05:29Z")

</div>

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