Automatic ID generation (noob question)


(rtm443x) #1

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
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://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://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://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.
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.


(David Pilato) #2

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/

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 11 juillet 2014 à 16:01:43, rtm443x@googlemail.com (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

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 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.
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 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.
For more options, visit https://groups.google.com/d/optout.


(Glen Smith) #3

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 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] <
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://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://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://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://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.
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.


(rtm443x) #4

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 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] <
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://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://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://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://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.
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.


(system) #5