我有一个POST API REST端点:https://api.qa.my-server.com/abc/def/order/_startScroll?offset=0&limit=10000&fields=
点击ElasticSearch服务器。在JSON body中,我们传递以下内容:
{
"@type": "SearchDetails",
"@baseType": "SearchDetails",
"@schemaLocation": "",
"name": "myStuff",
"filter": [
{
"@type": "FilterGroup",
"@baseType": "FilterGroup",
"@schemaLocation": "",
"filter": [
{
"@type": "AttributeFilter",
"@baseType": "AttributeFilter",
"@schemaLocation": "",
"field": "source.sourceSystemId",
"value": [
"test"
],
"operator": "eq",
"caseInsensitive": "true"
},
{
"@type": "AttributeFilter",
"@baseType": "AttributeFilter",
"@schemaLocation": "",
"field": "lastUpdated",
"value": [
"2023-05-06T16:35:00"
],
"operator": "gte",
"caseInsensitive": "true"
}
],
"groupOperator": "AND",
"groupModifier": "null"
}
],
"sort": [
{
"field": "source.orderDate",
"direction": "DESC"
}
]
}
这个搜索查询只返回10,000个elasticsearch请求,这是最大限制,我想使用滚动或其他东西来检索所有结果(大约有1,000,000个结果)。
API端点具有参数limit
,该参数基本上是结果集的大小。
1条答案
按热度按时间qvk1mo1f1#
您应该设置索引设置:
出于性能原因,不建议使用此方法。这定义了根据from和size参数检索的最大文档数(from + size不能高于使用的设置)