automatic ID generation (noob question)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

automatic ID generation (noob question)

rtm443x
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>

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

  curl.exe -XPOST 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/ -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/ -T go.txt), I added "?pretty" for readability (ie: curl.exe -XPOST 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/038004c1-114e-455a-a6c8-5c1aff3a7cf2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: automatic ID generation (noob question)

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


-- 
David Pilato | Technical Advocate | Elasticsearch.com


Le 11 juillet 2014 à 16:01:43, [hidden email] ([hidden email]) 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>

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

  curl.exe -XPOST 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/ -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/ -T go.txt), I added "?pretty" for readability (ie: curl.exe -XPOST 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/038004c1-114e-455a-a6c8-5c1aff3a7cf2%40googlegroups.com.
For more options, visit 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 [hidden email].
To view this discussion on the web visit 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.
Reply | Threaded
Open this post in threaded view
|

Re: automatic ID generation (noob question)

Glen Smith
In reply to this post by rtm443x
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, [hidden email] 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] <<a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2Fcurrent%2Fdocs-index_.html\46sa\75D\46sntz\0751\46usg\75AFQjCNHVxDo7CnAcm3LL9ZMH8U3azUVFUA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2Fcurrent%2Fdocs-index_.html\46sa\75D\46sntz\0751\46usg\75AFQjCNHVxDo7CnAcm3LL9ZMH8U3azUVFUA';return true;">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 <a href="http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNFaLCKB2g_jrkvN34Sh2-nui24zsw" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet\46sa\75D\46sntz\0751\46usg\75AFQjCNFaLCKB2g_jrkvN34Sh2-nui24zsw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet\46sa\75D\46sntz\0751\46usg\75AFQjCNFaLCKB2g_jrkvN34Sh2-nui24zsw';return true;">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 <a href="http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w';return true;">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 <a href="http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w';return true;">http://localhost:9200/twitter/tweet/ -T go.txt), I added "?pretty" for readability (ie: curl.exe -XPOST <a href="http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w';return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1356e906-2355-4d62-a0cf-ab3e94da1993%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: automatic ID generation (noob question)

rtm443x
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, [hidden email] 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] <<a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2Fcurrent%2Fdocs-index_.html\46sa\75D\46sntz\0751\46usg\75AFQjCNHVxDo7CnAcm3LL9ZMH8U3azUVFUA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2Fcurrent%2Fdocs-index_.html\46sa\75D\46sntz\0751\46usg\75AFQjCNHVxDo7CnAcm3LL9ZMH8U3azUVFUA';return true;">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 <a href="http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNFaLCKB2g_jrkvN34Sh2-nui24zsw" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet\46sa\75D\46sntz\0751\46usg\75AFQjCNFaLCKB2g_jrkvN34Sh2-nui24zsw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet\46sa\75D\46sntz\0751\46usg\75AFQjCNFaLCKB2g_jrkvN34Sh2-nui24zsw';return true;">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 <a href="http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w';return true;">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 <a href="http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w';return true;">http://localhost:9200/twitter/tweet/ -T go.txt), I added "?pretty" for readability (ie: curl.exe -XPOST <a href="http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Flocalhost%3A9200%2Ftwitter%2Ftweet%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNH-yzen07NdyF7mdRiqZbHIfrKv4w';return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/77c26830-5649-49b8-8c06-5ee732c85555%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.