# Automatic ID generation (noob question)

**URL:** <https://discuss.elastic.co/t/automatic-id-generation-noob-question/18602>\
**Category:** Elasticsearch\
**Created:** [July 11, 2014, 2:01pm UTC](https://discuss.elastic.co/t/automatic-id-generation-noob-question/18602 "2014-07-11T14:01:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rtm443x](https://avatars.discourse-cdn.com/v4/letter/r/9fc348/32.png) [@rtm443x](https://discuss.elastic.co/u/rtm443x)\
**Post date:** [July 11, 2014, 2:01pm UTC](https://discuss.elastic.co/t/automatic-id-generation-noob-question/18602/1 "2014-07-11T14:01:39Z")

</div>

Hi all,  
first post. Am working through the ElasticSearch Server book (packt). Not  
getting what I expect with automatic id gen.  
Using similar example from your website [1]  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index\_.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html)

With a file go.txt (given below) I entered this

curl.exe -XPOST [http://localhost:9200/twitter/tweet](http://localhost:9200/twitter/tweet)  
[http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet&sa=D&sntz=1&usg=AFQjCNFaLCKB2g\_jrkvN34Sh2-nui24zsw](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet&sa=D&sntz=1&usg=AFQjCNFaLCKB2g_jrkvN34Sh2-nui24zsw)  
-T go.txt

got back this

{"\_index":"twitter","\_type":"  
tweet","\_id":"VJcZR33ETjC1W8LX1CnL0w","\_version":1,"created":true}

Ok, it works as expected, but this

curl.exe -XPOST [http://localhost:9200/twitter/tweet/](http://localhost:9200/twitter/tweet/)  
[http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w)  
-T go.txt

failed:

{"\_index":"twitter","\_type":"tweet","\_id":"go.txt","\_version":6,"created":false}

Only difference is the trailing backslash on the URL.  
FYI contents of go.txt is straight off your website [1]

* * *

## { "user" : "kimchy", "post\_date" : "2009-11-15T14:12:12", "message" : "trying out Elasticsearch" }

Even [1] shows a trailing forward slash used, and it apparently succeeds.

Furthermore, only found this when it failed with a forwardslash (ie:  
curl.exe -XPOST [http://localhost:9200/twitter/tweet/](http://localhost:9200/twitter/tweet/)  
[http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w)  
-T go.txt), I added "?pretty" for readability (ie: curl.exe -XPOST  
[http://localhost:9200/twitter/tweet/](http://localhost:9200/twitter/tweet/)  
[http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w)?pretty  
-T go.txt) and it succeeded! Which I'm sure it shouldn't do.

Machine is windows server 2008 R2 (64-bit), curl is 7.33.0, java is  
1.7.0.55. Everything is being run locally, single node etc. Really basic.  
Used a file as embedding the contents in-line is a bit scrappy in windows.

Need more info? can anyone reproduce?

thanks

jan

--  
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/038004c1-114e-455a-a6c8-5c1aff3a7cf2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/038004c1-114e-455a-a6c8-5c1aff3a7cf2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 11, 2014, 4:21pm UTC](https://discuss.elastic.co/t/automatic-id-generation-noob-question/18602/2 "2014-07-11T16:21:23Z")

</div>

My advice: don't use curl.exe on windows.  
You should take a look at Marvel which comes with SENSE.

It's free for development: [http://www.elasticsearch.org/overview/marvel/](http://www.elasticsearch.org/overview/marvel/)

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 11 juillet 2014 à 16:01:43, [rtm443x@googlemail.com](mailto:rtm443x@googlemail.com) ([rtm443x@googlemail.com](mailto:rtm443x@googlemail.com)) a écrit:

Hi all,  
first post. Am working through the ElasticSearch Server book (packt). Not getting what I expect with automatic id gen.  
Using similar example from your website [1] [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index\_.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html)

With a file go.txt (given below) I entered this

curl.exe -XPOST [http://localhost:9200/twitter/tweet](http://localhost:9200/twitter/tweet) -T go.txt

got back this

{"\_index":"twitter","\_type":"  
tweet","\_id":"VJcZR33ETjC1W8LX1CnL0w","\_version":1,"created":true}

Ok, it works as expected, but this

curl.exe -XPOST [http://localhost:9200/twitter/tweet/](http://localhost:9200/twitter/tweet/) -T go.txt

failed:

{"\_index":"twitter","\_type":"tweet","\_id":"go.txt","\_version":6,"created":false}

Only difference is the trailing backslash on the URL.  
FYI contents of go.txt is straight off your website [1]

* * *

## { "user" : "kimchy", "post\_date" : "2009-11-15T14:12:12", "message" : "trying out Elasticsearch" }

Even [1] shows a trailing forward slash used, and it apparently succeeds.

Furthermore, only found this when it failed with a forwardslash (ie: curl.exe -XPOST [http://localhost:9200/twitter/tweet/](http://localhost:9200/twitter/tweet/) -T go.txt), I added "?pretty" for readability (ie: curl.exe -XPOST [http://localhost:9200/twitter/tweet/?pretty](http://localhost:9200/twitter/tweet/?pretty) -T go.txt) and it succeeded! Which I'm sure it shouldn't do.

Machine is windows server 2008 R2 (64-bit), curl is 7.33.0, java is 1.7.0.55. Everything is being run locally, single node etc. Really basic. Used a file as embedding the contents in-line is a bit scrappy in windows.

Need more info? can anyone reproduce?

thanks

## jan

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/038004c1-114e-455a-a6c8-5c1aff3a7cf2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/038004c1-114e-455a-a6c8-5c1aff3a7cf2%40googlegroups.com).  
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/etPan.53c00f03.333ab105.70e%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53c00f03.333ab105.70e%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Glen\_Smith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glen_smith/32/111656_2.png) [@Glen\_Smith](https://discuss.elastic.co/u/Glen_Smith)\
**Post date:** [July 11, 2014, 6:46pm UTC](https://discuss.elastic.co/t/automatic-id-generation-noob-question/18602/3 "2014-07-11T18:46:52Z")

</div>

Yeah, since the response is referring to your local file name, it's pretty  
clear that the problem here is with curl.exe - it's obviously not sending  
the file contents in your second example, it's sending the file name.

On Friday, July 11, 2014 10:01:39 AM UTC-4, [rtm...@googlemail.com](mailto:rtm...@googlemail.com) wrote:

> Hi all,  
> first post. Am working through the Elasticsearch Server book (packt). Not  
> getting what I expect with automatic id gen.  
> Using similar example from your website [1] \<  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html)\>
> 
> With a file go.txt (given below) I entered this
> 
> curl.exe -XPOST [http://localhost:9200/twitter/tweet](http://localhost:9200/twitter/tweet)  
> [http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet&sa=D&sntz=1&usg=AFQjCNFaLCKB2g\_jrkvN34Sh2-nui24zsw](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet&sa=D&sntz=1&usg=AFQjCNFaLCKB2g_jrkvN34Sh2-nui24zsw)  
> -T go.txt
> 
> got back this
> 
> {"\_index":"twitter","\_type":"  
> tweet","\_id":"VJcZR33ETjC1W8LX1CnL0w","\_version":1,"created":true}
> 
> Ok, it works as expected, but this
> 
> curl.exe -XPOST [http://localhost:9200/twitter/tweet/](http://localhost:9200/twitter/tweet/)  
> [http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w)  
> -T go.txt
> 
> failed:
> 
> {"\_index":"twitter","\_type":"tweet","\_id":"go.txt","\_version":6,"created":false}
> 
> Only difference is the trailing backslash on the URL.  
> FYI contents of go.txt is straight off your website [1]
> 
> * * *
> 
> ## { "user" : "kimchy", "post\_date" : "2009-11-15T14:12:12", "message" : "trying out Elasticsearch" }
> 
> Even [1] shows a trailing forward slash used, and it apparently succeeds.
> 
> Furthermore, only found this when it failed with a forwardslash (ie:  
> curl.exe -XPOST [http://localhost:9200/twitter/tweet/](http://localhost:9200/twitter/tweet/)  
> [http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w)  
> -T go.txt), I added "?pretty" for readability (ie: curl.exe -XPOST  
> [http://localhost:9200/twitter/tweet/](http://localhost:9200/twitter/tweet/)  
> [http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w)?pretty  
> -T go.txt) and it succeeded! Which I'm sure it shouldn't do.
> 
> Machine is windows server 2008 R2 (64-bit), curl is 7.33.0, java is  
> 1.7.0.55. Everything is being run locally, single node etc. Really basic.  
> Used a file as embedding the contents in-line is a bit scrappy in windows.
> 
> Need more info? can anyone reproduce?
> 
> thanks
> 
> jan

--  
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/1356e906-2355-4d62-a0cf-ab3e94da1993%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1356e906-2355-4d62-a0cf-ab3e94da1993%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![rtm443x](https://avatars.discourse-cdn.com/v4/letter/r/9fc348/32.png) [@rtm443x](https://discuss.elastic.co/u/rtm443x)\
**Post date:** [July 11, 2014, 7:08pm UTC](https://discuss.elastic.co/t/automatic-id-generation-noob-question/18602/4 "2014-07-11T19:08:43Z")

</div>

Good point!

thanks

On Friday, July 11, 2014 7:46:52 PM UTC+1, Glen Smith wrote:

> Yeah, since the response is referring to your local file name, it's pretty  
> clear that the problem here is with curl.exe - it's obviously not sending  
> the file contents in your second example, it's sending the file name.
> 
> On Friday, July 11, 2014 10:01:39 AM UTC-4, [rtm...@googlemail.com](mailto:rtm...@googlemail.com) wrote:
> 
> > Hi all,  
> > first post. Am working through the Elasticsearch Server book (packt). Not  
> > getting what I expect with automatic id gen.  
> > Using similar example from your website [1] \<  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html)\>
> > 
> > With a file go.txt (given below) I entered this
> > 
> > curl.exe -XPOST [http://localhost:9200/twitter/tweet](http://localhost:9200/twitter/tweet)  
> > [http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet&sa=D&sntz=1&usg=AFQjCNFaLCKB2g\_jrkvN34Sh2-nui24zsw](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet&sa=D&sntz=1&usg=AFQjCNFaLCKB2g_jrkvN34Sh2-nui24zsw)  
> > -T go.txt
> > 
> > got back this
> > 
> > {"\_index":"twitter","\_type":"  
> > tweet","\_id":"VJcZR33ETjC1W8LX1CnL0w","\_version":1,"created":true}
> > 
> > Ok, it works as expected, but this
> > 
> > curl.exe -XPOST [http://localhost:9200/twitter/tweet/](http://localhost:9200/twitter/tweet/)  
> > [http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w)  
> > -T go.txt
> > 
> > failed:
> > 
> > {"\_index":"twitter","\_type":"tweet","\_id":"go.txt","\_version":6,"created":false}
> > 
> > Only difference is the trailing backslash on the URL.  
> > FYI contents of go.txt is straight off your website [1]
> > 
> > * * *
> > 
> > ## { "user" : "kimchy", "post\_date" : "2009-11-15T14:12:12", "message" : "trying out Elasticsearch" }
> > 
> > Even [1] shows a trailing forward slash used, and it apparently succeeds.
> > 
> > Furthermore, only found this when it failed with a forwardslash (ie:  
> > curl.exe -XPOST [http://localhost:9200/twitter/tweet/](http://localhost:9200/twitter/tweet/)  
> > [http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w)  
> > -T go.txt), I added "?pretty" for readability (ie: curl.exe -XPOST  
> > [http://localhost:9200/twitter/tweet/](http://localhost:9200/twitter/tweet/)  
> > [http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&sa=D&sntz=1&usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w)?pretty  
> > -T go.txt) and it succeeded! Which I'm sure it shouldn't do.
> > 
> > Machine is windows server 2008 R2 (64-bit), curl is 7.33.0, java is  
> > 1.7.0.55. Everything is being run locally, single node etc. Really basic.  
> > Used a file as embedding the contents in-line is a bit scrappy in windows.
> > 
> > Need more info? can anyone reproduce?
> > 
> > thanks
> > 
> > jan

--  
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/77c26830-5649-49b8-8c06-5ee732c85555%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/77c26830-5649-49b8-8c06-5ee732c85555%40googlegroups.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, 1:16am UTC](https://discuss.elastic.co/t/automatic-id-generation-noob-question/18602/5 "2017-07-06T01:16:24Z")

</div>


