簡體   English   中英

無法在Elasticsearch中完全創建索引

[英]Unable to fully create index in elasticsearch

我是Elasticsearch的新手,對不起,這是一個新手問題:-)

我已經閱讀了文檔,正在嘗試創建索引。

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號終端的快照(由於沒有空位,我將其切成兩半):

終端快照1

Snapshot2:

Snapshot2

我很困惑,因為:

  • acknowledges:true然后突然停止解釋代碼
  • 所有的花括號都正確匹配,所以我不明白為什么它說不unmatched brace

謝謝。

Windows上正確的curl命令如下:

curl -X PUT "http://127.0.0.1:9200/test2" -d "{ \"mappings\": { \"_doc\": { \"properties\": { \"user\" : { \"type\": \"keyword\" } } } } }"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM