Skip to content

Search: crawl(pageSize)(searchFn)(maxResults) #3

@vlaurin

Description

@vlaurin

Crawl and aggregate multiple pages of results for a search operation.

Example usage

import {crawl, search, searchDsl as s} from '@quickcase/node-toolkit';

const query = s.query(s.equals('state', 'Active'));
const sort = s.sort(s.sortAsc('state'));
const searchFn = search(httpClient)('CaseType1')(query)(sort);

const response = await crawl(50)(searchFn)(1000);
/* response:
{
  results: [...]
}
*/

Comment

Easy to abuse, slow and expensive to run. Are so many non-paginated results really required? Query refinement and pagination should be favoured.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions