OpenSearch文档说fetch_size
是受支持的,应该可以工作。但是,这在OpenSearch 2. 5. 3中肯定不适合我。
查询1:
POST _plugins/_sql/
{
"query" : "SELECT start_time FROM my_opensearch_index"
}
答复1:
{
"schema": [
{
"name": "start_time",
"type": "timestamp"
}
],
"datarows": [
[
"2022-12-01 02:46:18.406516529"
],
[
"2022-12-01 02:46:15.83386667"
],
...
],
[
"2022-12-01 02:57:49.658765135"
]
],
"total": 200,
"size": 200,
"status": 200
}
200
似乎是SQL
查询的默认值size
。但是,当我尝试以下查询时:
查询2:
POST _plugins/_sql/
{
"fetch_size" : 5,
"query" : "SELECT start_time FROM my_opensearch_index"
}
答复2:
{
"error": {
"reason": "There was internal problem at backend",
"details": "Index type [my_opensearch_index] does not exist",
"type": "IllegalArgumentException"
},
"status": 500
}
注意,Query 2
中唯一的变化是在查询中添加了"fetch_size" : 5,
。
注:这是在OpenSearch 2.5.3上完成的;我还没有在ElasticSearch上尝试过这个,我知道他们有一个类似的功能。
1条答案
按热度按时间vlf7wbxs1#
尝试在
FROM
子句中使用索引名称,而不是索引别名。在这种情况下,正确索引别名are not handled。