docs(creators): totalItems/totalPages are lower bounds on ?query= search - #5
Open
ZacxDev wants to merge 1 commit into
Open
docs(creators): totalItems/totalPages are lower bounds on ?query= search#5ZacxDev wants to merge 1 commit into
ZacxDev wants to merge 1 commit into
Conversation
…= search The /api/v1/creators search path (civitai #3097) dropped the pathological exact COUNT (username LIKE '%q%' ∩ has-models: ~800ms-1.4s per keystroke request) in favour of a take+1 hasMore probe. On the query path totalItems/totalPages are now monotonic lower bounds (exact on the final page); nextPage is the authoritative next-page signal. The unfiltered listing keeps its exact cached count. Document this for external API consumers.
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.
What
Documents a behaviour change from civitai #3097 for external consumers of
GET /api/v1/creators.On the
?query=search path, the endpoint no longer returns an exact total. #3097 dropped the pathological exact COUNT (username LIKE '%q%'∩models: { some: {} }— a leading-wildcard scan of the ~900k-row Model table, ~800ms–1.4s on every keystroke request, ~53,000s of replica CPU / 37d in prod) in favour of atake+1hasMoreprobe.Consequences documented:
metadata.totalItems/metadata.totalPagesare monotonic lower bounds on the query path (exact only on the final page).metadata.nextPageis the authoritative "another page exists" signal — consumers should follow it rather than computecurrentPage < totalPages.query) is unchanged — still an exact (cached) count.Why
Existing docs recommend
?query=prefix-walking for deep traversal, so external consumers paging that path need to know the totals are now bounds andnextPageis the correct pagination signal.Docs-only; no code.