Class SearchRequest<T>

Interface to iterate through results from API endpoints that return results in pages. Use in one of three ways:

  1. Get all results as an array: await request.exec() == <array>
  2. Get each page of results: await request.nextPage() == { current, total, items: <array> }
  3. Use for await to get all results one at a time: for await (let hit of request) { }

Type Parameters

  • T

Hierarchy (View Summary)

Constructors

Properties

current: number
done: boolean
options: Required<Rev.SearchOptions<T>>
total: undefined | number

Methods

  • Go through all pages of results and return as an array. TIP: Use the {maxResults} option to limit the maximum number of results

    Returns Promise<T[]>