Skip to content Skip to sidebar Skip to footer

'no Handler Found For Uri [/myindex] And Method [post]' Elasticsearch 5.0.3 With Nodejs Esclient

I am trying to create an index using the npm package elasticsearch and have been recieving the following error. 'No handler found for uri [/myindex] and method [POST]' esClient.ind

Solution 1:

You need to update your JavaScript client as well and instantiate it with the apiVersion parameter set to 5.0

var esClient = new elasticsearch.Client({ 
   host: config.es.host, 
   log: 'error',
   apiVersion: '5.0'
});

The reason for this is that as ES 5.0 it is not possible to create a new index using the POST HTTP method, but only with the PUT method

Post a Comment for "'no Handler Found For Uri [/myindex] And Method [post]' Elasticsearch 5.0.3 With Nodejs Esclient"