# UniqueID by File Name?

**URL:** <https://discuss.elastic.co/t/uniqueid-by-file-name/6544>\
**Category:** Elasticsearch\
**Created:** [January 30, 2012, 9:26pm UTC](https://discuss.elastic.co/t/uniqueid-by-file-name/6544 "2012-01-30T21:26:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_Estrada](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adam_estrada/32/2704_2.png) [@Adam\_Estrada](https://discuss.elastic.co/u/Adam_Estrada)\
**Post date:** [January 30, 2012, 9:26pm UTC](https://discuss.elastic.co/t/uniqueid-by-file-name/6544/1 "2012-01-30T21:26:23Z")

</div>

I am using pyes to index some metadata about files on my network. Each  
record has a unique id that is generated by the system but that means that  
there are duplicate records in my index. Is there a way I can use the file  
path as my unique id? I can set id= but when I do that I get an  
error. I think its because of spaces in the paths.

Thoughts?  
Adam

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [January 31, 2012, 3:52pm UTC](https://discuss.elastic.co/t/uniqueid-by-file-name/6544/2 "2012-01-31T15:52:37Z")

</div>

Maybe pyes does not URL encode the ID when it sends the request?

On Monday, January 30, 2012 at 11:26 PM, Adam Estrada wrote:

> I am using pyes to index some metadata about files on my network. Each record has a unique id that is generated by the system but that means that there are duplicate records in my index. Is there a way I can use the file path as my unique id? I can set id= but when I do that I get an error. I think its because of spaces in the paths.
> 
> Thoughts?  
> Adam

---

<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, 3:40am UTC](https://discuss.elastic.co/t/uniqueid-by-file-name/6544/3 "2017-07-06T03:40:59Z")

</div>

Closed on July 6, 2017, 3:40am UTC


