How to pass parameter using elasticsearchClient.sql() for ElasticSearch version 8.1.3

Viewed 10

I am trying to replicate scenario mentioned at Passing parameters to a query for Java ElasticSearchClient. However, I am not able to find function/api in co.elastic.clients.elasticsearch.sql.QueryRequest where we can pass params so that it will get converted to

POST /_sql?format=txt
{
    "query": "SELECT YEAR(release_date) AS year FROM library WHERE page_count > ? AND author = ? GROUP BY year HAVING COUNT(*) > ?",
    "params": [300, "Frank Herbert", 0]
}

The one provided is params(Map<String,JsonData>), I am not finding it suitable neither I am able to search on Google or even ElasticSearch reference Docs.

Any help/sample is really appreciated.

0 Answers
Related