New python client (8.x) for sql query

I am using sql query in my old python client 7.x and it works like this

data = es.sql.query(body={"query": sql_query1, "fetch_size": 30000})

now using new client 8.x it give me this warning
DeprecationWarning: The 'body' parameter is deprecated and will be removed in a future version. Instead use individual parameters.

I can't figure out how to use this individual parameter. can't seems to find something related to that in document and don't see any example anywhere

anyone has any idea?

Try the new syntax from : Examples | Elasticsearch Python Client [8.9] | Elastic


response ="my-index", body= sql_query1, size=3000)

ok this is how it works now.
I am using sql query hence have to use es.sql.query
you can use if using rest query

data = es.sql.query(query = sql_query1, fetch_size= 10000)

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.