【发布时间】:2019-03-06 15:47:13
【问题描述】:
我是弹性搜索的新手,很抱歉这是一个新手问题:-)
我已阅读文档,并且正在尝试创建索引。
curl -X PUT -x "" "http://127.0.0.1:9200"/test2 { "mappings": { "_doc": { "prope
rties": { "user" : { "type": "keyword" } } } } }
但我明白了:
{"acknowledged":true,"shards_acknowledged":true,"index":"test2"}curl: (3) unmatc
hed brace in URL position 1:
{
^
curl: (6) Could not resolve host: mappings
curl: (3) unmatched brace in URL position 1:
{
^
curl: (6) Could not resolve host: _doc
curl: (3) unmatched brace in URL position 1:
{
^
curl: (6) Could not resolve host: properties
curl: (3) unmatched brace in URL position 1:
{
^
curl: (6) Could not resolve host: user
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>405 Method Not Allowed</title>
</head><body>
<h1>Method Not Allowed</h1>
<p>The requested method PUT is not allowed for the URL /index.html.</p>
</body></html>
curl: (3) unmatched brace in URL position 1:
{
^
curl: (6) Could not resolve host: type
curl: (6) Could not resolve host: keyword
curl: (3) unmatched close brace/bracket in URL position 1:
}
^
curl: (3) unmatched close brace/bracket in URL position 1:
}
^
curl: (3) unmatched close brace/bracket in URL position 1:
}
^
curl: (3) unmatched close brace/bracket in URL position 1:
}
^
curl: (3) unmatched close brace/bracket in URL position 1:
}
^
如果我运行curl -X GET -x "" "http://127.0.0.1:9200"/test
我明白了:
{"test":{"aliases":{},"mappings":{},"settings":{"index":{"creation_date":"155119
5109041","number_of_shards":"5","number_of_replicas":"1","uuid":"WNIucwr0T8aniZk
PrVLoNA","version":{"created":"6060099"},"provided_name":"test"}}}}
快照(1号航站楼(我把它剪成一半,因为没有空间):
快照2:
我很困惑,因为:
- 它
acknowledges:true然后突然停止解释代码 - 所有大括号都正确匹配,所以我不明白为什么它说
unmatched brace
谢谢。
【问题讨论】:
-
再次查看双引号
"http://127.0.0.1:9200"/test2。不好!
标签: elasticsearch curl put