Hi Guys,
A quick question please.
I am playing around with the new SQL syntax feature: https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-syntax-select.html
But I noticed that the SQL Rest API is currently not available in the official elasticsearch-py API yet - or maybe I'm missing something?
I am currently working around this by using the Transport.perform_request()
function to perform the request like so but if you know a better way please do let me know:
# 'es' is the instantiated Elasticsearch client
query = {
"query": 'SELECT some_field FROM "some_table" LIMIT 10'
}
results = es.transport.perform_request('POST', '/_xpack/sql', params={'format': 'json'}, body=query)
Cheers,