使用 Elasticsearch 查询 DSL 进行过滤
Elastic Stack Serverless
可以使用标准的 Elasticsearch 查询 DSL,通过在 filter 参数中指定查询来过滤 SQL 将在其上运行的结果。
POST /_sql?format=txt
{
"query": "SELECT * FROM library ORDER BY page_count DESC",
"filter": {
"range": {
"page_count": {
"gte" : 100,
"lte" : 200
}
}
},
"fetch_size": 5
}
返回
author | name | page_count | release_date
---------------+------------------------------------+---------------+------------------------
Douglas Adams |The Hitchhiker's Guide to the Galaxy|180 |1979-10-12T00:00:00.000Z