在Elasticsearch中使用from / size-“在滚动上下文中不允许使用[from]”

时间:2019-03-08 15:00:15

标签: elasticsearch

我有一个相当标准的查询,似乎正在使用滚动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}'

0 个答案:

没有答案