Skip to content

Add _shards to Search result type#15

Merged
rusty-key merged 1 commit intoahrefs:masterfrom
Atlas07:br/add-shards-to-search-result
Mar 2, 2026
Merged

Add _shards to Search result type#15
rusty-key merged 1 commit intoahrefs:masterfrom
Atlas07:br/add-shards-to-search-result

Conversation

@Atlas07
Copy link
Copy Markdown
Contributor

@Atlas07 Atlas07 commented Mar 1, 2026

Summary

  • Include shard info (total, successful, skipped, failed) as an optional field in the generated ATD result type for Search queries
  • Enables typed access to shard failure data instead of manual JSON parsing in consumers
  • Field is optional (?_shards: _shards nullable) so existing code only needs ; _ in pattern matches

Context

ES can return HTTP 200 with partial results when some shards fail (e.g. memory limits). Currently consumers have to manually parse _shards from raw JSON before calling the ATD-generated parser, resulting in double parsing. With this change, _shards is part of the typed result.

Include shard failure info (total, successful, skipped, failed) as an
optional field in the generated ATD result type for Search queries,
enabling typed access to shard failure data instead of manual JSON parsing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rusty-key rusty-key merged commit 0fc97f5 into ahrefs:master Mar 2, 2026
Atlas07 added a commit to Atlas07/esgg that referenced this pull request Mar 6, 2026
The _shards type was added to search results in PR ahrefs#15 but the test
expected outputs were not regenerated. Update all test output.atd files
to match the current code generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rr0gi pushed a commit that referenced this pull request Mar 9, 2026
The _shards type was added to search results in PR #15 but the test
expected outputs were not regenerated. Update all test output.atd files
to match the current code generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants