我无法通过Java API连接到vanilla ElasticSearch集群.
重现:
#start elasticsearch
elasticsearch -f
#checking in a new window
$ curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{\
"user" : "kimchy",\
"post_date" : "2009-11-15T14:12:12",\
"message" : "trying out Elastic Search"\
}'
Run Code Online (Sandbox Code Playgroud)
结果:
{
"ok": true,
"_index": "twitter",
"_type": "tweet",
"_id": "1",
"_version": 3
}
Run Code Online (Sandbox Code Playgroud)
$ curl -XGET 'http://localhost:9200/twitter/tweet/_search?q=user:kimchy'
Run Code Online (Sandbox Code Playgroud)
结果:
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.30685282,
"hits": [
{
"_index": "twitter",
"_type": "tweet",
"_id": "1",
"_score": …Run Code Online (Sandbox Code Playgroud)