# Unicode characters and spaces in elasticsearch field names

**URL:** <https://discuss.elastic.co/t/unicode-characters-and-spaces-in-elasticsearch-field-names/21678>\
**Category:** Elasticsearch\
**Created:** [January 16, 2015, 8:21am UTC](https://discuss.elastic.co/t/unicode-characters-and-spaces-in-elasticsearch-field-names/21678 "2015-01-16T08:21:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![George](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@George](https://discuss.elastic.co/u/George)\
**Post date:** [January 16, 2015, 8:21am UTC](https://discuss.elastic.co/t/unicode-characters-and-spaces-in-elasticsearch-field-names/21678/1 "2015-01-16T08:21:34Z")

</div>

Hello everybody,

I've researched a little bit what characters are allowed in elasticsearch  
field names.  
However, I couldn't find any official documentation only some posts which  
mentioned that '.', '#' and '\*' are discouraged.  
See [http://elasticsearch-users.115913.n3.nabble.com/Illegal-characters-in-elasticsearch-field-names-td4054773.html](http://elasticsearch-users.115913.n3.nabble.com/Illegal-characters-in-elasticsearch-field-names-td4054773.html).

I've indexed some fields which contained spaces and unicode  
characters with elasticsearch 1.4.2 ("lucene\_version": "4.10.2"). I was  
able to retrieve the documents with  
term query without any problems.

My question would be, are there any pitfalls when using unicode characters  
and spaces in elasticsearch field names? or is this discouraged?

Many thanks,  
George

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0c2a3b7b-0b3c-47e3-b149-ecad7d1e9a30%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0c2a3b7b-0b3c-47e3-b149-ecad7d1e9a30%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![George](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@George](https://discuss.elastic.co/u/George)\
**Post date:** [January 18, 2015, 9:36pm UTC](https://discuss.elastic.co/t/unicode-characters-and-spaces-in-elasticsearch-field-names/21678/2 "2015-01-18T21:36:32Z")

</div>

Does anybody have an idea at least where in the elasticsearch code this is  
handled?

Thanks!

On Friday, January 16, 2015 at 9:21:34 AM UTC+1, George wrote:

> Hello everybody,
> 
> I've researched a little bit what characters are allowed in elasticsearch  
> field names.  
> However, I couldn't find any official documentation only some posts which  
> mentioned that '.', '#' and '\*' are discouraged. See  
> [http://elasticsearch-users.115913.n3.nabble.com/Illegal-characters-in-elasticsearch-field-names-td4054773.html](http://elasticsearch-users.115913.n3.nabble.com/Illegal-characters-in-elasticsearch-field-names-td4054773.html)  
> .
> 
> I've indexed some fields which contained spaces and unicode  
> characters with elasticsearch 1.4.2 ("lucene\_version": "4.10.2"). I was  
> able to retrieve the documents with  
> term query without any problems.
> 
> My question would be, are there any pitfalls when using unicode characters  
> and spaces in elasticsearch field names? or is this discouraged?
> 
> Many thanks,  
> George

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d4a24d5a-c932-45c9-81d8-59323dd767bf%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d4a24d5a-c932-45c9-81d8-59323dd767bf%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 18, 2015, 10:22pm UTC](https://discuss.elastic.co/t/unicode-characters-and-spaces-in-elasticsearch-field-names/21678/3 "2015-01-18T22:22:20Z")

</div>

You can find this in the source code.

E.g.

org.elasticsearch.index.mapper.ContentPath -\> see delimiter variable, it is  
'.' by default

org.elasticsearch.index.mapper.Uid -\> see DELIMITER, it is set to '#'

and for '\*'

org.elasticsearch.index.mapper.FieldMappersLookup and  
org.elasticsearch.index.mapper.object.DynamicTemplate -\> are using  
org.elasticsearch.common.reges.Regex.simpleMatch on field names, a  
simplified regex routine which supports _abc, a_bc, and abc\* patterns

Jörg

On Sun, Jan 18, 2015 at 10:36 PM, George [george.pucea@gmail.com](mailto:george.pucea@gmail.com) wrote:

> Does anybody have an idea at least where in the elasticsearch code this is  
> handled?
> 
> Thanks!
> 
> On Friday, January 16, 2015 at 9:21:34 AM UTC+1, George wrote:
> 
> > Hello everybody,
> > 
> > I've researched a little bit what characters are allowed in elasticsearch  
> > field names.  
> > However, I couldn't find any official documentation only some posts which  
> > mentioned that '.', '#' and '\*' are discouraged. See  
> > [http://elasticsearch-users.115913.n3.nabble.com/Illegal-characters-in-](http://elasticsearch-users.115913.n3.nabble.com/Illegal-characters-in-)  
> > elasticsearch-field-names-td4054773.html.
> > 
> > I've indexed some fields which contained spaces and unicode  
> > characters with elasticsearch 1.4.2 ("lucene\_version": "4.10.2"). I was  
> > able to retrieve the documents with  
> > term query without any problems.
> > 
> > My question would be, are there any pitfalls when using unicode  
> > characters and spaces in elasticsearch field names? or is this discouraged?
> > 
> > Many thanks,  
> > George
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/d4a24d5a-c932-45c9-81d8-59323dd767bf%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d4a24d5a-c932-45c9-81d8-59323dd767bf%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/d4a24d5a-c932-45c9-81d8-59323dd767bf%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d4a24d5a-c932-45c9-81d8-59323dd767bf%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEQJJSBEjAg0a-hSny%3DbmM-oD5Rp1OBHmNXUs-\_-SoSaA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEQJJSBEjAg0a-hSny%3DbmM-oD5Rp1OBHmNXUs-_-SoSaA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:38am UTC](https://discuss.elastic.co/t/unicode-characters-and-spaces-in-elasticsearch-field-names/21678/4 "2017-07-06T00:38:08Z")

</div>


