我試圖使用npm包elasticsearch創建索引,並且已經收到以下錯誤。'爲uri [/ myindex]和方法[POST]找到沒有處理程序'Elasticsearch 5.0.3 with nodejs esclient
'找到的URI [/ myindex]和方法[POST]沒有處理機'
esClient.indices.create({ index: 'myindex' }, function(err, resp, status) { cb(err, resp); });
下面的代碼所工作Elasticsearch 2.3
這裏是追蹤日誌
Elasticsearch DEBUG: 2017-04-03T13:54:24Z
starting request { method: 'POST', path: '/myindex1', query: {} }
Elasticsearch TRACE: 2017-04-03T13:54:24Z
-> POST http://localhost:9200/myindex1
<- 400
No handler found for uri [/myindex1] and method [POST]
Elasticsearch DEBUG: 2017-04-03T13:54:24Z
Request complete
{ Error: Bad Request
at respond (/Users/Ut/Fitternity/metropolis/node_modules/elasticsearch/src/lib/transport.js:293:15)
at checkRespForFailure (/Users/Ut/Fitternity/metropolis/node_modules/elasticsearch/src/lib/transport.js:252:7)
at HttpConnector.<anonymous> (/Users/Ut/Fitternity/metropolis/node_modules/elasticsearch/src/lib/connectors/http.js:155:
7)
at IncomingMessage.wrapper (/Users/Ut/Fitternity/metropolis/node_modules/elasticsearch/node_modules/lodash/index.js:3095
:19)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:926:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
status: 400,
displayName: 'BadRequest',
message: 'Bad Request' } 'No handler found for uri [/myindex1] and method [POST]' 400
[ 'No handler found for uri [/myindex1] and method [POST]' ]
你能不能也告訴你如何建立你的' esClient'? – Val
var esClient = new elasticsearch.Client({host:config.es.host, log:'error' }); –
你是否更新過JavaScript客戶端? – Val