Core
API v2.x
2

scroll #

Moves a search cursor forward.

A search cursor is created by a search API call, with a scroll value provided.

Results returned by a scroll request reflect the state of the index at the time of the initial search request, like a fixed snapshot. Subsequent changes to documents do not affect the scroll results.

The maximum value for a scroll session can be configured under the configuration key services.storageEngine.maxScrollDuration.


Query Syntax #

HTTP #

Copied to clipboard!
URL: http://kuzzle:7512/_scroll/<scrollId>[?scroll=<time to live>]
Method: GET

Other protocols #

Copied to clipboard!
{
  "controller": "document",
  "action": "scroll",
  "scrollId": "<scrollId>",
  "scroll": "<time to live>"
}

Arguments #

  • scrollId: cursor unique identifier, obtained by either a search or a scroll query

Optional: #

  • scroll: refresh the cursor duration, using the time to live syntax.

Kourou #

Copied to clipboard!
kourou document:scroll -a scrollId=<scrollId> -a scroll=<time to live>

Response #

Returns a paginated search result set, with the following properties:

  • hits: array of found documents. Each document has the following properties:
  • remaining: remaining documents that can be fetched
    Available since 2.4.0
  • scrollId: identifier to the next page of result. Can be different than the previous one(s)
  • total: total number of found documents. Usually greater than the number of documents in a result page
Copied to clipboard!
{
  "status": 200,
  "error": null,
  "action": "scroll",
  "controller": "document",
  "requestId": "<unique request identifier>",
  "result": {
    "scrollId": "<new scroll id>",
    "hits": [
      {
        "_id": "<document unique identifier>",
        "_score": 1,
        "_source": {
          // document content
        }
      },
      {
        "_id": "<another document unique identifier>",
        "_score": 1,
        "_source": {
          // document content
        }
      }
    ],
    "total": 42
  }
}