client6.sql.query is not work
See original GitHub issueelastic version: 6.6.2
my code:
const { Client: Client7 } = require('@elastic/elasticsearch')
const client6 = new Client7({ node: 'http://localhost:9200' })
let aa = await client6.sql.query({
body: {
query: `SELECT * FROM "${this.elastic_name}"`,
}
});
Correct interface request:
POST _xpack/sql?format=json
{
"query":"SELECT * FROM \"f271444afc2479560efc51b68a0cc996\" limit 10"
}
He works normally.
but api/sql.query.js
line 82:
path = '/' + '_sql'
The request is:
{ method: 'POST',
path: '/_sql',
body: { query: 'SELECT * FROM "f271444afc2479560efc51b68a0cc996"' },
querystring: {} }
error:
{ body:
{ error: 'Incorrect HTTP method for uri [/_sql] and method [POST], allowed: [PUT, DELETE, GET, HEAD]',
status: 405 },
Change the code to :
path = '/' + '_xpack/sql'
Can operate normally
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (7 by maintainers)
Top Results From Across the Web
How to troubleshoot SQL Server error 8645 - Microsoft Support
You may see the following 8645 error sporadically: Error 8645: A time out occurred while waiting for memory resources to execute the query....
Read more >sql query is not working properly - Stack Overflow
i am using sql query to get the result. my first table is snd_marketvisits this table have properties like id ,pjpCode , section...
Read more >MySQL
MySQL HeatWave is a fully managed service that enables customers to run OLTP, OLAP, and machine learning workloads directly from their MySQL Database....
Read more >SQL AND, OR, NOT Operators - W3Schools
CustomerID CustomerName ContactName Address
1 Alfreds Futterkiste Maria Anders Obere Str. 57
2 Ana Trujillo Emparedados y helados Ana Trujillo Avda. de la Constitución...
3 Antonio...
Read more >The7 — Website and eCommerce Builder for WordPress
The theme is compatible with a wide range of search engine optimization plugins, ... The "Gradient" option is not working for image hovers....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For whoever is looking for a direct solution, here it is.
@mitjafelicijan you can’t change the path via an option, as this client is generated from the Elasticsearch’s spec. You can either use the
transport.request
or use theextend
API and override the default implementation.