我有一个相当标准的查询,似乎正在使用滚动API-如何更改它以使用from / size(非滚动)API?
我的查询:
{
"query": {
"bool": {
"should": [
{ "match": { "object.id": query } },
{ "match": { "object.name": query } },
{ "match": { "object.content": query } },
{ "match": { "object.type": query } }
]
}
},
"_source": "object.*",
"from" : from_result,
"size": RESULTS_PER_PAGE
}
返回的错误是:
b'{"error": {"root_cause": [{"type": "action_request_validation_exception", "reason": "Validation Failed: 1: using [from] is not allowed in a scroll context;"}], "type": "action_request_validation_exception", "reason": "Validation Failed: 1: using [from] is not allowed in a scroll context;"}, "status": 400}'