我在localhost上使用带有河插件的长沙发进行弹性搜索。 我的数据库还可以,并且运行良好
跟随this doc:
我正试图用卷曲来创造一条河:
curl -XPUT 'localhost:9200/_river/establishments/_meta' -d '{
"type" : "couchdb",
"couchdb" : {
"host" : "localhost",
"port" : 5984,
"db" : "establishments",
"filter" : null
},
"index" : {
"index" : "establishments",
"type" : "establishments",
"bulk_size" : "100",
"bulk_timeout" : "10ms"
}
}'
然后Windows提示此错误:
curl: (6) Could not resolve host: 'localhost
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: couchdb,couchdb
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: {host
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: localhost,port
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: 5984,db
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: etablissement,filter
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: null},index
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: {index
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: etablissement,type
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: etablissement,bulk_size
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: 100,bulk_timeout
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: 10ms}}'curl
curl: (6) Could not resolve host: 'localhost
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: couchdb,couchdb
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: {host
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: localhost,port
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: 5984,db
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: etablissement,filter
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: null},index
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: {index
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: etablissement,type
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: etablissement,bulk_size
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: 100,bulk_timeout
curl: (3) Bad URL, colon is first character
curl: (6) Could not resolve host: 10ms}}'
我不明白我要做什么才能使它工作
我尝试添加-g,但是没有运气。
编辑1: 我知道它来自Windows,所以我添加了这样的双引号:
curl -XPUT "localhost:9200/_river/etablissement/_meta" -d "{"type" : "couchdb","couchdb" : {"host" : "localhost","port" : 5984,"db" : "etablissement","filter" : null},"index" : {"index" : "etablissement","type" : "etablissement","bulk_size" : "100","bulk_timeout" : "10ms"}}"
但是现在我已经解决了这个错误:
{"error":"MapperParsingException[failed to parse]; nested: JsonParseException[Unrecognized token 'couchdb': was expecting ('true', 'false' or 'null')\n at [Source: [B@2f87b041; line: 1, column: 17]]; ","status":400}
编辑2已解决:
最后我在记事本++中用\进行了转义,并且有效:
curl -XPUT "localhost:9200/_river/etablissement/_meta" -d "{\"type\" : \"couchdb\",\"couchdb\" : {\"host\" : \"localhost\",\"port\" : 5984,\"db\" : \"etablissement\",\"filter\" : null},\"index\" : {\"index\" : \"etablissement\",\"type\" : \"etablissement\",\"bulk_size\" : \"100\",\"bulk_timeout\" : \"10ms\"}}"
晚安