Friday, 8 November 2019

Elasticsearch SQL-Query not possible

I got a ElasticSearch Instance running locally which works fine. Now I want to query an index using SQL. I tried it with the NodeJS-Client (v7) and normally via the REST-Api. Rest call:

POST http://localhost:9200/_sql
{
   "body": {
       "query": "DESCRIBE indexname"
   }
}

And via nodeJS:

elasticClient.sql.query({
    format: "json",
    body: {
        query: "DESCRIBE indexname"
    }
}).then(result => {
    console.log(result);
}).catch(reject => {
    console.log(reject);
});

Both give back the same error:

Incorrect HTTP method for uri [/_sql] and method [POST], allowed: [GET, HEAD, PUT, DELETE] status: 405

Can anyone help? Cheers!



from Elasticsearch SQL-Query not possible

No comments:

Post a Comment