只需在我的Mac(brew install elasticsearch
)上安装ElasticSearch。
然后以brew services start elasticsearch
开头。
我可以看到它正在运行:
curl localhost:9200
{
"name" : "84ucGje",
"cluster_name" : "elasticsearch_dnk306",
"cluster_uuid" : "yU6wdZpJT_-1OvaFf7l7Ug",
"version" : {
"number" : "6.5.0",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "816e6f6",
"build_date" : "2018-11-09T18:58:36.352602Z",
"build_snapshot" : false,
"lucene_version" : "7.5.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
当我尝试向其中添加一些索引时-失败并显示406错误:
curl -XPOST localhost:9200/test/1 -d '{"title":"Hello world"}'
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}
我需要做什么才能使这项工作成功?
谢谢。