# Naming an index or a type with URIs

**URL:** <https://discuss.elastic.co/t/naming-an-index-or-a-type-with-uris/15306>\
**Category:** Elasticsearch\
**Created:** [January 18, 2014, 10:07am UTC](https://discuss.elastic.co/t/naming-an-index-or-a-type-with-uris/15306 "2014-01-18T10:07:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olivier\_Rossel](https://avatars.discourse-cdn.com/v4/letter/o/ea666f/32.png) [@Olivier\_Rossel](https://discuss.elastic.co/u/Olivier_Rossel)\
**Post date:** [January 18, 2014, 10:07am UTC](https://discuss.elastic.co/t/naming-an-index-or-a-type-with-uris/15306/1 "2014-01-18T10:07:41Z")

</div>

Is it technically possible to name an index or a type with a URI string (containing dots, slashes, colons, ...)?  
I have tried to do some curl stuff with an URL like [http://localhost:9200/](http://localhost:9200/)\<urlencoded\_index\_uri\>/\<urlencoded\_type\_uri\>/... but it didn't seem to work very well.  
Are there technical issues with this kind of naming? Or is it possible to name indices and types with URIs? In that case, what would a sample Elasticsearch URL look like?

I appreciate all advice from the community. Thx!

--  
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/5114ee1d-e020-42f1-b081-2c7c7ca667f4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5114ee1d-e020-42f1-b081-2c7c7ca667f4%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2014, 10:30am UTC](https://discuss.elastic.co/t/naming-an-index-or-a-type-with-uris/15306/2 "2014-01-18T10:30:14Z")

</div>

Index names must be lowercase and must not contain characters that are  
problematic in file names, because they are used as directory name.

Type names are not used in the file system but to conform with index names,  
they are also restricted.

I also use URIs in Elasticsearch. You can use them as field names and field  
values. In field values, they can be used for linking data.

But i recommend to build URIs dynamically in the middleware where  
addressing is implemented, so you can move or reassign URIs more easily,  
just by changing a global config without the need to reindex or reset alias.

Jörg

--  
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/CAKdsXoHmbLAicWrRfTijGBiQ8Q%3DwRzXdD34j1vKaNg1YAm73gQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHmbLAicWrRfTijGBiQ8Q%3DwRzXdD34j1vKaNg1YAm73gQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 18, 2014, 10:32am UTC](https://discuss.elastic.co/t/naming-an-index-or-a-type-with-uris/15306/3 "2014-01-18T10:32:41Z")

</div>

I think I would base64 encode the URL and lowercase it.

I did not try it though.

My 2 cents.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 18 janv. 2014 à 11:07, Olivier Rossel [olivier.rossel@gmail.com](mailto:olivier.rossel@gmail.com) a écrit :

> Is it technically possible to name an index or a type with a URI string (containing dots, slashes, colons, ...)?  
> I have tried to do some curl stuff with an URL like [http://localhost:9200/](http://localhost:9200/)\<urlencoded\_index\_uri\>/\<urlencoded\_type\_uri\>/... but it didn't seem to work very well.  
> Are there technical issues with this kind of naming? Or is it possible to name indices and types with URIs? In that case, what would a sample Elasticsearch URL look like?
> 
> I appreciate all advice from the community. Thx!
> 
> --  
> 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/5114ee1d-e020-42f1-b081-2c7c7ca667f4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5114ee1d-e020-42f1-b081-2c7c7ca667f4%40googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/77EAC54A-D360-48E8-AE39-BC830D23A63E%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/77EAC54A-D360-48E8-AE39-BC830D23A63E%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:56am UTC](https://discuss.elastic.co/t/naming-an-index-or-a-type-with-uris/15306/4 "2017-07-06T01:56:04Z")

</div>

Closed on July 6, 2017, 1:56am UTC


