Skip to content

perf: cap or warn when --json is used with unbounded --max-docs in scroll-search #211

Closed

Description

@ssh-esh

Raised in PR #207 review.

When --json is active, es helpers scroll-search buffers all documents in memory to return a single JSON object. Since --max-docs defaults to Infinity then this could OOM on large indices.

The original NDJSON streaming path avoids this by writing each document to stdout immediately, but --json mode requires buffering by design

Options to consider:

Set a sensible default cap for --max-docs when --json is active (e.g. 10,000)
Emit a stderr warning when --json is combined with unbounded --max-docs
Both — warn and cap, with an explicit --max-docs Infinity to override

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions