docs(search): document the interactive and batch search modes - #441
Merged
Merged
Conversation
POST /v1/search accepts an optional `mode` field that declares how the client intends to consume a paginated search. `interactive`, the default, favors time to first results with smaller pages. `batch` favors total throughput over the whole result set with fewer, larger pages. Add a Search Modes section to Query Limits & Performance covering when to use each mode, how the field is sent once and inherited by continuation pages, why it is a hint rather than a setting, and the `searchMode`, `pageSize` and `paginatedByteCap` stats every page reports about the shape it actually ran as. Add a request example and a pointer to that section from the Query Console page, where the search request body is documented. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Add a Fetch Large Result Sets in Batch Mode subsection to Writing Efficient and Performant Queries, so a reader looking for how to make a query faster finds the advice next to the other efficiency practices, and cross-link it with the Search Modes reference in both directions. The reason is stated as a mechanism: every page costs a fixed amount of work and one network round trip regardless of how many rows it carries, so fewer and larger pages spend less of the run on that fixed cost, and the saving grows with the number of pages fetched. Add a matching Anti-patterns entry for paging a large export to the end in the default interactive mode. Flatten the register of the Search Modes prose to match the rest of the page. Drop the sentence that announced the trade-off before stating it, and replace the figurative phrasings with plain ones. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The mode field is documented as a hint, and the section now says what that means for a client: the server decides the mode each page runs in, that decision can go in either direction, and what it is based on is server-side and can change. A search can therefore run in batch mode without asking for it. Corrects two statements that the hint framing makes wrong: - "asking for batch where it is not enabled leaves the search on interactive" is not what happens. Refusing the client's field lets the rest of the resolution run, so an organization whose default is batch still gets batch. The text now says the search runs in whatever mode the server would have chosen had the field not been sent. - An unrecognized or mis-cased value is treated as though the field were omitted, not as interactive. Those differ once a server-side selection can apply. The mode table carries the same correction. Trims the three places that now said the same thing twice: the repeated "never fails a request", the repeated "read the applied mode from the page", and the index page promising a link to an explanation it had just given. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
Documents the optional
modefield onPOST /v1/search, which lets a client declare how it intends to consume a paginated search.interactiveis the default and favors time to first results with smaller pages.batchfavors total throughput over the whole result set with fewer, larger pages, so the complete set arrives after fewer round trips.The field is an intent, not a size. The client never sends a row count, the server decides the page size, and results and their ordering are identical in both modes. Only the placement of page boundaries changes.
What is documented
POSTthat starts the search. Continuation pages fetched with the pagination token inherit it, so it is neither resent nor carried in the token. A request example shows the field in the body.interactive. What the selection is based on is documented as server-side and subject to change, so a client is told not to depend on a given search running in a given mode. Three things bound it: the server may select the mode itself, batch mode is enabled per organization, and batch mode applies only to a paginated search. AGROUP BY, anORDER BY, or an aggregation over all records runs without pagination and is unaffected.interactive. The client's field is dropped and the rest of the resolution runs, so an organization whose default is batch still gets batch. The page says the search runs in whatever mode the server would have chosen had the field not been sent."Batch", and a non-string value are all ignored and treated as though the field were omitted, so the request does not fail on the field.searchMode,pageSizeandpaginatedByteCap, all omitted for a search that ran without pagination. A note explains thatpageSizeis not a promise about a row count, since a page can end below it or slightly above it.Where it lives
The reference material is a new
## Search Modessection indocs/4-data-queries/query-limits-and-performance.md, placed after Data Sources and before Concurrent Queries. That page already documents pagination, page shape, the paged versus whole-timeline distinction that decides whether the mode applies at all, and the per-page stats, so the new material sits next to everything it refers to and reuses those anchors.The same page gains
### Fetch Large Result Sets in Batch Modeunder## Writing Efficient and Performant Queries, alongside Prefer Projections, Narrow the Scope Early and the rest, plus one### Anti-patternsentry for paging a large export to the end in the default interactive mode. A reader asking how to make a query faster lands in that section rather than in the reference one, so the advice lives there and links to Search Modes for how to request the mode and what comes back. Search Modes links forward to it in turn, so neither copy repeats the other.docs/4-data-queries/index.mdgains a short### Choose a Search Modesubsection between Run an LCQL Query and Validate Query Syntax. That page is where the search request body is documented, so it carries the one-paragraph summary and the request example and links onward for the detail.No new page is added, and no existing wording is rewritten beyond one sentence in the intro of the limits page that now also names search modes.
Checks
mkdocs build --strictpasses.markdownlint-cli2with the repo config reports 0 errors across all pages.scripts/check-list-numbering.py,scripts/check-release-note-headings.pyandscripts/check-release-feeds.pyall pass against the built site, andpytest tests/is green.#search-modes,#when-to-use-batch-mode,#requesting-a-mode,#what-each-page-reports,#fetch-large-result-sets-in-batch-mode), the cross-page link from the Query Console page, and the links between the two new sections were verified in the built output.🤖 Generated with Claude Code