Search a collection with a query and return the most similar documents. Optionally rerank globally merged candidates with a model provided by LambdaDB before the final size limit. Rerank is configured per query; omitted/null preserves existing behavior. See the Native reranking guide for candidate depth, score meaning, and failure policy.
For query-level reranking, see Native reranking for default and custom criteria, candidate depth, final scores, and fallback behavior. LambdaDB manages provider credentials.
Authorizations
x-api-key
string
header
required
Project API Key.
Path Parameters
collectionName
string
required
Collection name.
Body
application/json
size
integer | null
default:10
Number of documents to return, from 0 to 1000. Defaults to 10 when omitted or null. Zero requires at least one facet; facet counts cover all matching documents regardless of this size. Rerank requires a positive size; this remains the final returned-document limit, distinct from candidateSize and each knn.k.
Required range: 0 <= x <= 1000
query
object | null
conditionally required
Query object. For native embedding vector fields, use knn.queryText or ordered knn.queryInputs parts with explicit type (text or image) and string value. Cohere accepts mixed parts, OpenAI one text part. A raw knn.queryVector is also accepted for native fields and skips inference. Each knn query requires exactly one non-null queryText, queryInputs or queryVector and has its own k from 1 to 1000, independent of size and candidateSize. Text and multimodal inputs require a native embedding vector field. queryInputs uses the same part, image and byte limits as document inputs. All automatic query inputs are prepared before the first provider call; Cohere preparation checks inference quota before retrieving images. Query structure and per-leg bounds are validated by the server. Omit or use null to match all documents. Facets support queryString and bool queries only; vector, sparse vector, and hybrid queries cannot be combined with facets. Bayesian fusion uses a top-level bayesian array of exactly two unboosted subqueries, with no nested fusion or boosts on Boolean descendants. See the Hybrid query guide for candidate budgets.
consistentRead
boolean
default:false
Overlay eligible pending writes on the selected branch's committed data. Defaults to false. Allowed when ref selects a branch directly or an alias that currently targets a branch; the alias is resolved to its branch when the request is admitted. Tag reads and an alias that targets a tag reject true with 400. Pending bulk imports are excluded. Returns 429 if the pending payload exceeds the consistent-read limit.
includeVectors
boolean
default:false
If your application need to include vector values in the response, set includeVectors to true.
sort
object[] | null
List of field name, sort direction pairs. Omitted or null means no explicit sort. A non-null sort list, including an empty list, cannot be combined with rerank.
fields
object
An object to specify a list of field names to include and/or exclude in the result.
Option 1
Option 2
Show child attributes
partitionFilter
PartitionFilter · object
Show child attributes
ref
RefContext · object
Read ref selector. A ref that does not exist returns 404 ResourceNotFound; an alias whose target is dangling returns 400 BadRequest.
Show child attributes
facets
object | null
requiredifsize=0
Exact document counts by indexed keyword value. Keys are keyword field names, including dotted paths. Applies all query and partition filters and the selected ref. At most 10,000 distinct (field, value) buckets and 262,144 UTF-8 value bytes across requested fields; exceeding either bound returns 400 instead of partial counts. Separate memory admission limits return 400 when one request exceeds its estimated budget, or 429 when concurrent requests temporarily exhaust a budget. Request fewer fields or partitions for memory-limit errors; retry temporary 429 errors with backoff.
Show child attributes
rerank
object | null
Optional native reranking for this query, not a collection setting. Omitted or null preserves existing search behavior. LambdaDB manages provider credentials; no provider API key is supplied by the caller. Request validation, field types, UTF-8 byte limits, and size <= candidateSize are checked by the server.
Show child attributes
candidateSize
integer | null
Required for top-level Bayesian fusion without rerank: 1 <= size <= candidateSize <= 1000. Controls retrieval and calibration depth per signal, independently of final size and each knn.k. With rerank, omit this field and use rerank.candidateSize. Other query types must omit it. Null is treated as omitted; query semantics and the cross-field size bound are validated by the server.
Required range: 1 <= x <= 1000
Response
Documents selected by query.
took
integer
required
Complete request elapsed time in milliseconds, including reranking when requested.
total
integer
required
Total number of documents returned.
docs
object[]
required
List of documents.
Show child attributes
isDocsInline
boolean
required
Whether docs are included inline. When false, docs is empty and the result items must be downloaded from docsUrl.
maxScore
number
Maximum final score among returned documents. Applied reranking uses the final evaluation scores; fallback keeps search scores. Omitted for empty results or when no score is computed. Numeric zero is a valid maximum.
docsUrl
string
Presigned download URL when isDocsInline is false. GET the complete URL without forwarding the LambdaDB API key. Returns a JSON array of result items, not an object with a docs field. Applied reranking preserves score and retrievalScore in each downloaded envelope; rerank metadata stays in the top-level response.
facets
object
Present when facets were requested, including empty buckets for fields without matching values. Remains inline when documents are served through docsUrl. total remains the number of returned documents, not the facet population.
Show child attributes
rerank
object
Present only when rerank was requested. Whole-stage metadata remains inline even when documents are downloaded through docsUrl.
Show child attributes
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"LambdaDB Documentation","colors":{"primary":"#0D9373","light":"#07C983","dark":"#0D9373"},"logo":{"light":"https://mintcdn.com/lambdadb/fejsT7T9UaNPB1nX/logo/light.svg?fit=max\u0026auto=format\u0026n=fejsT7T9UaNPB1nX\u0026q=85\u0026s=3984578842930966eb2d9d05766af2cd","dark":"https://mintcdn.com/lambdadb/p3ZLnnGiGP71YxJM/logo/dark.svg?fit=max\u0026auto=format\u0026n=p3ZLnnGiGP71YxJM\u0026q=85\u0026s=18498f8b90cd8979b463acbae342f9b1"},"favicon":"https://mintcdn.com/lambdadb/fejsT7T9UaNPB1nX/favicon.svg?fit=max\u0026auto=format\u0026n=fejsT7T9UaNPB1nX\u0026q=85\u0026s=6f7e3b6dbe311b4da3a87224c799b276","api":{"playground":{"display":"simple"}},"navbar":{"links":[{"href":"mailto:support@lambdadb.ai","label":"Support"}]},"footer":{"socials":{"github":"https://github.com/lambdadb","linkedin":"https://www.linkedin.com/company/lambdadb","x":"https://x.com/lambdadbai","reddit":"https://www.reddit.com/r/vectorlake","slack":"https://lambdadbcommunity.slack.com/join/shared_invite/zt-3sg7565zm-sCTW3odRkEQt~auWUVVsTw"}},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"lambdadb","hasAudioNarration":false,"actualSubdomain":"lambdadb","customDomains":["docs.lambdadb.ai"],"gitSource":{"type":"github","owner":"lambdadb","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{},"buildId":"6aedc24bc42bb37e7408153b","clientVersion":"0.0.4167","searchFilterCounts":[{"language":"default","tag":"Guides","count":38},{"language":"default","tag":"Reference","count":26},{"language":"default","tag":"APIs","count":25},{"language":"default","tag":"Documents","count":14},{"language":"default","tag":"Collections","count":11},{"language":"default","tag":"Search","count":10},{"language":"default","tag":"Branches, tags \u0026 aliases","count":10},{"language":"default","tag":"Get started","count":8},{"language":"default","tag":"Migrations","count":6},{"language":"default","tag":"Query","count":5}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"reference/api/endpoint/document-query","slug":"/reference/api/endpoint/document-query","pageMetadata":{"title":"Query a collection","openapi":"post /collections/{collectionName}/query","description":"Search a collection with a query and return the most similar documents. Optionally rerank globally merged candidates with a model provided by LambdaDB before the final size limit. Rerank is configured per query; omitted/null preserves existing behavior. See the Native reranking guide for candidate depth, score meaning, and failure policy.","href":"/reference/api/endpoint/document-query"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Search a collection with a query and return the most similar documents. Optionally rerank globally merged candidates with a model provided by LambdaDB before the final size limit. Rerank is configured per query; omitted/null preserves existing behavior. See the Native reranking guide for candidate depth, score meaning, and failure policy.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,p:`p`,..._provideComponents(),...props.components};return _jsxs(_components.p,{children:[`For query-level reranking, see `,_jsx(_components.a,{href:`/guides/search/native-reranking`,children:`Native reranking`}),` for default and custom criteria, candidate depth, final scores, and fallback behavior. LambdaDB manages provider credentials.`]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Query a collection","openapi":"post /collections/{collectionName}/query","description":"Search a collection with a query and return the most similar documents. Optionally rerank globally merged candidates with a model provided by LambdaDB before the final size limit. Rerank is configured per query; omitted/null preserves existing behavior. See the Native reranking guide for candidate depth, score meaning, and failure policy.","href":"/reference/api/endpoint/document-query"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["collections"],"operationId":"queryCollection","description":"Search a collection with a query and return the most similar documents. Optionally rerank globally merged candidates with a model provided by LambdaDB before the final size limit. Rerank is configured per query; omitted/null preserves existing behavior. See the Native reranking guide for candidate depth, score meaning, and failure policy.","security":["8618adf4-1fb2-44fe-b37e-bf1529de56d9"],"parameters":["005e663c-0013-4a69-bc75-c6f0c4e366ca"],"requestBody":"8bcc1d1a-fbc7-44e8-b091-ed7db73bf1ab","responses":{"200":"69a37b0a-a694-4785-90ba-af2c0fd93b4f","400":"445d2c9e-a7bc-42ce-9087-dfc087bf541f","401":"45b4afd4-4ce6-4c97-b069-6d02fc92e0d8","403":"32c71bfb-5dfa-478d-916d-3d20ff4c6c09","404":"6cd6e100-e591-464a-b9eb-c7ac0fe55546","408":"2b1801f7-b816-4aa4-b26c-6a888658a388","413":"7fb213b5-9bbf-4f94-bde9-906df4064d39","429":"66a42533-0318-4e82-8bd2-ecf17bf60970","500":"cd75346e-245c-40d1-a3dd-c3eb760ee8ad","502":"43b6c9cb-0c36-4fb9-bb16-e391ce2e3b84","503":"54760ff3-8ac6-4f35-be2c-3496a896d1a7","504":"8bc4075e-156b-44ba-9922-6730eac291f0"},"summary":"Query a Collection","method":"post","type":"path","servers":["7431bbc0-1b39-40d2-b54d-415419b0c4d9"],"path":"/collections/{collectionName}/query","baseUrlOptions":["https://{projectHost}"],"title":"Query a Collection","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"005e663c-0013-4a69-bc75-c6f0c4e366ca":{"in":"path","name":"collectionName","description":"Collection name.","required":true,"schema":{"type":"string","isRequired":true,"description":"Collection name.","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","conditionallyRequiredProperties":{"facets":[{"when":[[{"property":"size","values":[0]}]]}],"query":[{}]},"properties":{"size":{"oneOf":[{"type":"integer","minimum":0,"maximum":1000,"default":10,"description":"Number of documents to return, from 0 to 1000. Defaults to 10 when omitted or null. Zero requires at least one facet; facet counts cover all matching documents regardless of this size. Rerank requires a positive size; this remains the final returned-document limit, distinct from candidateSize and each knn.k.","uniqueKey":"size.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":0,"maximum":1000,"default":10,"description":"Number of documents to return, from 0 to 1000. Defaults to 10 when omitted or null. Zero requires at least one facet; facet counts cover all matching documents regardless of this size. Rerank requires a positive size; this remains the final returned-document limit, distinct from candidateSize and each knn.k.","uniqueKey":"size.oneOf.1","typeLabel":"null"}],"uniqueKey":"size","typeLabel":"integer | null"},"query":{"oneOf":[{"type":"object","additionalProperties":true,"description":"Query object. For native embedding vector fields, use knn.queryText or ordered knn.queryInputs parts with explicit type (text or image) and string value. Cohere accepts mixed parts, OpenAI one text part. A raw knn.queryVector is also accepted for native fields and skips inference. Each knn query requires exactly one non-null queryText, queryInputs or queryVector and has its own k from 1 to 1000, independent of size and candidateSize. Text and multimodal inputs require a native embedding vector field. queryInputs uses the same part, image and byte limits as document inputs. All automatic query inputs are prepared before the first provider call; Cohere preparation checks inference quota before retrieving images. Query structure and per-leg bounds are validated by the server. Omit or use null to match all documents. Facets support queryString and bool queries only; vector, sparse vector, and hybrid queries cannot be combined with facets. Bayesian fusion uses a top-level bayesian array of exactly two unboosted subqueries, with no nested fusion or boosts on Boolean descendants. See the Hybrid query guide for candidate budgets.","conditionalRequirements":[{}],"uniqueKey":"query.oneOf.0","typeLabel":"object"},{"type":"null","additionalProperties":true,"description":"Query object. For native embedding vector fields, use knn.queryText or ordered knn.queryInputs parts with explicit type (text or image) and string value. Cohere accepts mixed parts, OpenAI one text part. A raw knn.queryVector is also accepted for native fields and skips inference. Each knn query requires exactly one non-null queryText, queryInputs or queryVector and has its own k from 1 to 1000, independent of size and candidateSize. Text and multimodal inputs require a native embedding vector field. queryInputs uses the same part, image and byte limits as document inputs. All automatic query inputs are prepared before the first provider call; Cohere preparation checks inference quota before retrieving images. Query structure and per-leg bounds are validated by the server. Omit or use null to match all documents. Facets support queryString and bool queries only; vector, sparse vector, and hybrid queries cannot be combined with facets. Bayesian fusion uses a top-level bayesian array of exactly two unboosted subqueries, with no nested fusion or boosts on Boolean descendants. See the Hybrid query guide for candidate budgets.","conditionalRequirements":[{}],"uniqueKey":"query.oneOf.1","typeLabel":"null"}],"conditionalRequirements":[{}],"uniqueKey":"query","typeLabel":"object | null"},"consistentRead":{"title":"ConsistentRead","type":"boolean","default":false,"description":"Overlay eligible pending writes on the selected branch's committed data. Defaults to false. Allowed when ref selects a branch directly or an alias that currently targets a branch; the alias is resolved to its branch when the request is admitted. Tag reads and an alias that targets a tag reject true with 400. Pending bulk imports are excluded. Returns 429 if the pending payload exceeds the consistent-read limit.","uniqueKey":"consistentRead","typeLabel":"boolean"},"includeVectors":{"title":"IncludeVectors","type":"boolean","default":false,"description":"If your application need to include vector values in the response, set includeVectors to true.","uniqueKey":"includeVectors","typeLabel":"boolean"},"sort":{"oneOf":[{"type":"array","description":"List of field name, sort direction pairs. Omitted or null means no explicit sort. A non-null sort list, including an empty list, cannot be combined with rerank.","items":{"type":"object","additionalProperties":true,"uniqueKey":"sort.oneOf.0.items.[INDEX]","typeLabel":"object"},"uniqueKey":"sort.oneOf.0","typeLabel":"object[]"},{"type":"null","description":"List of field name, sort direction pairs. Omitted or null means no explicit sort. A non-null sort list, including an empty list, cannot be combined with rerank.","items":{"type":"object","additionalProperties":true},"uniqueKey":"sort.oneOf.1","typeLabel":"null"}],"uniqueKey":"sort","typeLabel":"object[] | null"},"fields":{"oneOf":[{"type":"object","description":"An object to specify a list of field names to include and/or exclude in the result.","required":["include"],"properties":{"include":{"type":"array","description":"List of field names to include in the result.","items":{"type":"string","uniqueKey":"fields.oneOf.0.include.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"fields.oneOf.0.include","typeLabel":"string[]"},"exclude":{"type":"array","description":"List of field names to exclude in the result.","items":{"type":"string","uniqueKey":"fields.oneOf.0.exclude.items.[INDEX]","typeLabel":"string"},"uniqueKey":"fields.oneOf.0.exclude","typeLabel":"string[]"}},"uniqueKey":"fields.oneOf.0","typeLabel":"object"},{"type":"object","description":"An object to specify a list of field names to include and/or exclude in the result.","required":["exclude"],"properties":{"exclude":{"type":"array","description":"List of field names to exclude in the result.","items":{"type":"string","uniqueKey":"fields.oneOf.1.exclude.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"fields.oneOf.1.exclude","typeLabel":"string[]"},"include":{"type":"array","description":"List of field names to include in the result.","items":{"type":"string","uniqueKey":"fields.oneOf.1.include.items.[INDEX]","typeLabel":"string"},"uniqueKey":"fields.oneOf.1.include","typeLabel":"string[]"}},"uniqueKey":"fields.oneOf.1","typeLabel":"object"}],"uniqueKey":"fields","typeLabel":"object"},"partitionFilter":{"title":"PartitionFilter","type":"object","properties":{"field":{"type":"string","description":"Partition field name.","isRequired":true,"uniqueKey":"partitionFilter.field","typeLabel":"string"},"in":{"type":"array","description":"Partition values to filter.","items":{"type":"string","uniqueKey":"partitionFilter.in.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"partitionFilter.in","typeLabel":"string[]"}},"required":["field","in"],"uniqueKey":"partitionFilter","typeLabel":"PartitionFilter · object"},"ref":{"title":"RefContext","type":"object","description":"Read ref selector. A ref that does not exist returns 404 ResourceNotFound; an alias whose target is dangling returns 400 BadRequest.","additionalProperties":false,"properties":{"kind":{"type":"string","enum":["branch","tag","alias"],"isRequired":true,"uniqueKey":"ref.kind","typeLabel":"enum\u003cstring>"},"name":{"type":"string","minLength":3,"maxLength":52,"pattern":"^[a-zA-Z0-9_-]{3,52}$","isRequired":true,"uniqueKey":"ref.name","typeLabel":"string"}},"required":["kind","name"],"uniqueKey":"ref","typeLabel":"RefContext · object"},"facets":{"oneOf":[{"type":"object","maxProperties":5,"propertyNames":{"type":"string","pattern":".*\\S.*"},"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"size":{"oneOf":[{"type":"integer","minimum":1,"maximum":100,"default":10,"description":"Maximum buckets to return after global aggregation. Defaults to 10 when omitted or null.","uniqueKey":"facets.oneOf.0.additionalProperties.size.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":1,"maximum":100,"default":10,"description":"Maximum buckets to return after global aggregation. Defaults to 10 when omitted or null.","uniqueKey":"facets.oneOf.0.additionalProperties.size.oneOf.1","typeLabel":"null"}],"uniqueKey":"facets.oneOf.0.additionalProperties.size","typeLabel":"integer | null"}},"uniqueKey":"facets.oneOf.0.additionalProperties","typeLabel":"object"},"description":"Exact document counts by indexed keyword value. Keys are keyword field names, including dotted paths. Applies all query and partition filters and the selected ref. At most 10,000 distinct (field, value) buckets and 262,144 UTF-8 value bytes across requested fields; exceeding either bound returns 400 instead of partial counts. Separate memory admission limits return 400 when one request exceeds its estimated budget, or 429 when concurrent requests temporarily exhaust a budget. Request fewer fields or partitions for memory-limit errors; retry temporary 429 errors with backoff.","conditionalRequirements":[{"when":[[{"property":"size","values":[0]}]]}],"uniqueKey":"facets.oneOf.0","typeLabel":"object"},{"type":"null","maxProperties":5,"propertyNames":{"type":"string","pattern":".*\\S.*"},"additionalProperties":{"type":"object","additionalProperties":false,"properties":{"size":{"oneOf":[{"type":"integer","minimum":1,"maximum":100,"default":10,"description":"Maximum buckets to return after global aggregation. Defaults to 10 when omitted or null.","uniqueKey":"facets.oneOf.1.additionalProperties.size.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":1,"maximum":100,"default":10,"description":"Maximum buckets to return after global aggregation. Defaults to 10 when omitted or null.","uniqueKey":"facets.oneOf.1.additionalProperties.size.oneOf.1","typeLabel":"null"}],"uniqueKey":"facets.oneOf.1.additionalProperties.size","typeLabel":"integer | null"}},"uniqueKey":"facets.oneOf.1.additionalProperties","typeLabel":"object"},"description":"Exact document counts by indexed keyword value. Keys are keyword field names, including dotted paths. Applies all query and partition filters and the selected ref. At most 10,000 distinct (field, value) buckets and 262,144 UTF-8 value bytes across requested fields; exceeding either bound returns 400 instead of partial counts. Separate memory admission limits return 400 when one request exceeds its estimated budget, or 429 when concurrent requests temporarily exhaust a budget. Request fewer fields or partitions for memory-limit errors; retry temporary 429 errors with backoff.","conditionalRequirements":[{"when":[[{"property":"size","values":[0]}]]}],"uniqueKey":"facets.oneOf.1","typeLabel":"null"}],"conditionalRequirements":[{"when":[[{"property":"size","values":[0]}]]}],"uniqueKey":"facets","typeLabel":"object | null"},"rerank":{"oneOf":[{"type":"object","description":"Optional native reranking for this query, not a collection setting. Omitted or null preserves existing search behavior. LambdaDB manages provider credentials; no provider API key is supplied by the caller. Request validation, field types, UTF-8 byte limits, and size \u003c= candidateSize are checked by the server.","required":["provider","model","queryText","fields"],"properties":{"provider":{"type":"string","enum":["typesafe","cohere"],"description":"Required native reranking provider.","isRequired":true,"uniqueKey":"rerank.oneOf.0.provider","typeLabel":"enum\u003cstring>"},"model":{"type":"string","enum":["jev-1.13.0","rerank-v5.0-pro","rerank-v5.0-fast"],"description":"Required reranking model; independent of the collection embedding model.","isRequired":true,"uniqueKey":"rerank.oneOf.0.model","typeLabel":"enum\u003cstring>"},"queryText":{"type":"string","minLength":1,"pattern":".*\\S.*","description":"Required nonblank evaluation query, including for raw-vector or hybrid retrieval. At most 8 KiB UTF-8; never inferred from retrieval legs.","isRequired":true,"uniqueKey":"rerank.oneOf.0.queryText","typeLabel":"string"},"fields":{"type":"array","minItems":1,"maxItems":8,"uniqueItems":true,"items":{"type":"string","minLength":1,"pattern":".*\\S.*","uniqueKey":"rerank.oneOf.0.fields.items.[INDEX]","typeLabel":"string"},"description":"Ordered, unique stored scalar string paths, using dotted paths for nested fields. Paths do not need index configs. If configured, leaves must be text or keyword and configured ancestors must be objects. Empty or blank path segments are invalid; arrays, objects, and non-string values are invalid, including on unindexed stored paths. Values are checked before provider dispatch. Missing/null values are skipped, but every candidate must have at least one nonblank selected value. Only these fields enter model input; top-level fields controls the response projection. Rendered candidate text is limited to 16 KiB UTF-8, and query plus all rendered candidates plus custom criteria to 256 KiB.","isRequired":true,"uniqueKey":"rerank.oneOf.0.fields","typeLabel":"string[]"},"candidateSize":{"oneOf":[{"type":"integer","minimum":1,"maximum":1000,"description":"Upper bound on the globally merged and deduplicated rerank pool. Omitted or null defaults to max(50, size). Must satisfy size \u003c= candidateSize \u003c= 1000. Does not modify any knn.k and does not guarantee this many candidates.","uniqueKey":"rerank.oneOf.0.candidateSize.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":1,"maximum":1000,"description":"Upper bound on the globally merged and deduplicated rerank pool. Omitted or null defaults to max(50, size). Must satisfy size \u003c= candidateSize \u003c= 1000. Does not modify any knn.k and does not guarantee this many candidates.","uniqueKey":"rerank.oneOf.0.candidateSize.oneOf.1","typeLabel":"null"}],"uniqueKey":"rerank.oneOf.0.candidateSize","typeLabel":"integer | null"},"onFailure":{"oneOf":[{"type":"string","enum":["error","returnOriginal",null],"default":"error","description":"Omitted or null uses error. Provider timeout, rate limit, unavailable service, credential rejection, or invalid/incomplete scores follow this policy for the whole stage. returnOriginal keeps pre-rerank candidate order and search scores. Input/configuration, retrieval/hydration, authorization, quota, admission, and overall cancellation/deadline errors do not become fallback results.","uniqueKey":"rerank.oneOf.0.onFailure.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["error","returnOriginal",null],"default":"error","description":"Omitted or null uses error. Provider timeout, rate limit, unavailable service, credential rejection, or invalid/incomplete scores follow this policy for the whole stage. returnOriginal keeps pre-rerank candidate order and search scores. Input/configuration, retrieval/hydration, authorization, quota, admission, and overall cancellation/deadline errors do not become fallback results.","uniqueKey":"rerank.oneOf.0.onFailure.oneOf.1","typeLabel":"null"}],"uniqueKey":"rerank.oneOf.0.onFailure","typeLabel":"enum\u003cstring> | null"},"criteria":{"oneOf":[{"type":"array","minItems":2,"maxItems":10,"uniqueItems":true,"items":{"type":"string","minLength":1,"pattern":".*\\S.*","uniqueKey":"rerank.oneOf.0.criteria.oneOf.0.items.[INDEX]","typeLabel":"string"},"description":"TypeSafe/Jev only; Cohere requires omitted or null criteria. Distinct nonblank descriptions ordered from lowest to highest relevance. Omitted/null uses default-relevance-v1. Each description is limited to 2 KiB and the full list to 8 KiB UTF-8. Text is preserved exactly. Custom levels use uniformly spaced scores from 0 to 1; explicitly sending the default descriptions still selects custom scoring. Weights and thresholds are not supported.","uniqueKey":"rerank.oneOf.0.criteria.oneOf.0","typeLabel":"string[]"},{"type":"null","minItems":2,"maxItems":10,"uniqueItems":true,"items":{"type":"string","minLength":1,"pattern":".*\\S.*"},"description":"TypeSafe/Jev only; Cohere requires omitted or null criteria. Distinct nonblank descriptions ordered from lowest to highest relevance. Omitted/null uses default-relevance-v1. Each description is limited to 2 KiB and the full list to 8 KiB UTF-8. Text is preserved exactly. Custom levels use uniformly spaced scores from 0 to 1; explicitly sending the default descriptions still selects custom scoring. Weights and thresholds are not supported.","uniqueKey":"rerank.oneOf.0.criteria.oneOf.1","typeLabel":"null"}],"uniqueKey":"rerank.oneOf.0.criteria","typeLabel":"string[] | null"}},"additionalProperties":false,"uniqueKey":"rerank.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"rerank.oneOf.1","typeLabel":"null"}],"uniqueKey":"rerank","typeLabel":"object | null"},"candidateSize":{"oneOf":[{"type":"integer","minimum":1,"maximum":1000,"description":"Required for top-level Bayesian fusion without rerank: 1 \u003c= size \u003c= candidateSize \u003c= 1000. Controls retrieval and calibration depth per signal, independently of final size and each knn.k. With rerank, omit this field and use rerank.candidateSize. Other query types must omit it. Null is treated as omitted; query semantics and the cross-field size bound are validated by the server.","uniqueKey":"candidateSize.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":1,"maximum":1000,"description":"Required for top-level Bayesian fusion without rerank: 1 \u003c= size \u003c= candidateSize \u003c= 1000. Controls retrieval and calibration depth per signal, independently of final size and each knn.k. With rerank, omit this field and use rerank.candidateSize. Other query types must omit it. Null is treated as omitted; query semantics and the cross-field size bound are validated by the server.","uniqueKey":"candidateSize.oneOf.1","typeLabel":"null"}],"uniqueKey":"candidateSize","typeLabel":"integer | null"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"example":{"title":"example","summary":"Example request body for query collection","value":{"size":2,"query":{"queryString":{"query":"example-field1:example-value"}}}},"nativeEmbeddingKnnQuery":{"title":"nativeEmbeddingKnnQuery","summary":"Example request body for native embedding KNN query","value":{"size":10,"query":{"knn":{"field":"bodyEmbedding","queryText":"refund policy","k":10}}}},"keywordFacets":{"title":"keywordFacets","summary":"Keyword facets without document hits","value":{"size":0,"facets":{"tags":{"size":10}}}},"nativeReranking":{"title":"nativeReranking","summary":"Native reranking with default criteria and candidateSize=max(50, size)","value":{"size":2,"query":{"queryString":{"query":"restore collection","defaultField":"body"}},"fields":{"include":["id","title"]},"rerank":{"provider":"typesafe","model":"jev-1.13.0","queryText":"How do I restore a previous collection version?","fields":["title","body"]}}},"customReranking":{"title":"customReranking","summary":"Native reranking with three ordered custom descriptions","value":{"size":2,"query":{"queryString":{"query":"restore collection","defaultField":"body"}},"fields":{"include":["id","title"]},"rerank":{"provider":"typesafe","model":"jev-1.13.0","queryText":"How do I restore a previous collection version?","fields":["title","body"],"criteria":["Does not explain how to restore a collection version.","Explains part of the restore process but leaves essential steps unclear.","Provides the steps needed to restore the requested collection version."]}}},"bayesianHybrid":{"title":"bayesianHybrid","summary":"Bayesian hybrid search with an explicit candidate budget","value":{"size":10,"candidateSize":30,"query":{"bayesian":[{"queryString":{"query":"refund policy","defaultField":"body"}},{"knn":{"field":"bodyEmbedding","queryText":"What is the refund policy?","k":30}}]}}},"bayesianReranking":{"title":"bayesianReranking","summary":"Bayesian fusion followed by native reranking","value":{"size":10,"query":{"bayesian":[{"queryString":{"query":"refund policy","defaultField":"body"}},{"knn":{"field":"bodyEmbedding","queryText":"What is the refund policy?","k":30}}]},"rerank":{"provider":"typesafe","model":"jev-1.13.0","queryText":"What is the refund policy?","fields":["body"],"candidateSize":30}}},"cohereMultimodalKnnQuery":{"title":"cohereMultimodalKnnQuery","summary":"Mixed text and image retrieval on a Cohere native vector field","value":{"query":{"knn":{"field":"embedding","queryInputs":[{"type":"text","value":"red shoes"},{"type":"image","value":"https://example.com/shoe.png"}],"k":10}},"size":10}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"69a37b0a-a694-4785-90ba-af2c0fd93b4f":{"description":"Documents selected by query.","content":{"application/json":{"schema":{"type":"object","required":["took","total","docs","isDocsInline"],"properties":{"took":{"type":"integer","description":"Complete request elapsed time in milliseconds, including reranking when requested.","isRequired":true,"uniqueKey":"took","typeLabel":"integer"},"total":{"type":"integer","description":"Total number of documents returned.","isRequired":true,"uniqueKey":"total","typeLabel":"integer"},"docs":{"type":"array","description":"List of documents.","items":{"type":"object","properties":{"collection":{"type":"string","description":"Collection name.","isRequired":true,"uniqueKey":"docs.items.[INDEX].collection","typeLabel":"string"},"doc":{"type":"object","additionalProperties":true,"isRequired":true,"uniqueKey":"docs.items.[INDEX].doc","typeLabel":"object"},"score":{"type":"number","description":"Final sorting score. Applied reranking returns a double-precision evaluation score in [0,1], not a relevance probability. Without reranking or on fallback, this remains the original retrieval/fusion score and is not constrained to [0,1]. Omitted when the query does not compute a score. Numeric zero is valid; retain precision.","uniqueKey":"docs.items.[INDEX].score","typeLabel":"number"},"retrievalScore":{"type":"number","description":"Original retrieval/fusion score, present only when reranking was applied. A sibling of score and doc, not a field inside doc. Omitted when reranking is not requested, is skipped, or falls back; preserve original precision.","uniqueKey":"docs.items.[INDEX].retrievalScore","typeLabel":"number"}},"required":["collection","doc"],"uniqueKey":"docs.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"docs","typeLabel":"object[]"},"isDocsInline":{"type":"boolean","description":"Whether docs are included inline. When false, docs is empty and the result items must be downloaded from docsUrl.","isRequired":true,"uniqueKey":"isDocsInline","typeLabel":"boolean"},"maxScore":{"type":"number","description":"Maximum final score among returned documents. Applied reranking uses the final evaluation scores; fallback keeps search scores. Omitted for empty results or when no score is computed. Numeric zero is a valid maximum.","uniqueKey":"maxScore","typeLabel":"number"},"docsUrl":{"type":"string","description":"Presigned download URL when isDocsInline is false. GET the complete URL without forwarding the LambdaDB API key. Returns a JSON array of result items, not an object with a docs field. Applied reranking preserves score and retrievalScore in each downloaded envelope; rerank metadata stays in the top-level response.","uniqueKey":"docsUrl","typeLabel":"string"},"facets":{"type":"object","additionalProperties":{"type":"object","required":["buckets"],"properties":{"buckets":{"type":"array","description":"Ordered by count descending, then keyword Unicode code point order ascending. A document contributes once per distinct indexed value. Missing or unindexed values have no bucket.","items":{"type":"object","required":["value","count"],"properties":{"value":{"type":"string","isRequired":true,"uniqueKey":"facets.additionalProperties.buckets.items.[INDEX].value","typeLabel":"string"},"count":{"type":"integer","format":"int64","minimum":1,"isRequired":true,"uniqueKey":"facets.additionalProperties.buckets.items.[INDEX].count","typeLabel":"integer\u003cint64>"}},"uniqueKey":"facets.additionalProperties.buckets.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"facets.additionalProperties.buckets","typeLabel":"object[]"}},"uniqueKey":"facets.additionalProperties","typeLabel":"object"},"description":"Present when facets were requested, including empty buckets for fields without matching values. Remains inline when documents are served through docsUrl. total remains the number of returned documents, not the facet population.","uniqueKey":"facets","typeLabel":"object"},"rerank":{"type":"object","description":"Present only when rerank was requested. Whole-stage metadata remains inline even when documents are downloaded through docsUrl.","required":["status","provider","model","candidateCount","scoredCount","took"],"conditionallyRequiredProperties":{"reason":[{"when":[[{"property":"status","values":["skipped"],"matchesAbsent":true}]]},{"when":[[{"property":"status","values":["fallback"],"matchesAbsent":true}]]}]},"properties":{"status":{"type":"string","enum":["applied","skipped","fallback"],"isRequired":true,"uniqueKey":"rerank.status","typeLabel":"enum\u003cstring>"},"provider":{"type":"string","enum":["typesafe","cohere"],"description":"Requested provider.","isRequired":true,"uniqueKey":"rerank.provider","typeLabel":"enum\u003cstring>"},"model":{"type":"string","enum":["jev-1.13.0","rerank-v5.0-pro","rerank-v5.0-fast"],"description":"Requested model.","isRequired":true,"uniqueKey":"rerank.model","typeLabel":"enum\u003cstring>"},"candidateCount":{"type":"integer","minimum":0,"maximum":1000,"description":"Actual unique candidates in the rerank stage before final size limiting, not the returned-document count.","isRequired":true,"uniqueKey":"rerank.candidateCount","typeLabel":"integer"},"scoredCount":{"type":"integer","minimum":0,"maximum":1000,"description":"Equals candidateCount on applied results; zero for skipped/fallback. Partial scores are never exposed.","isRequired":true,"uniqueKey":"rerank.scoredCount","typeLabel":"integer"},"took":{"type":"integer","minimum":0,"description":"Rerank stage milliseconds after candidate hydration, including preparation and ordering or failure handling; not the complete request duration.","isRequired":true,"uniqueKey":"rerank.took","typeLabel":"integer"},"resolvedModel":{"type":"string","description":"Resolved model identity, when reported by the provider. Omitted otherwise.","uniqueKey":"rerank.resolvedModel","typeLabel":"string"},"criteriaVersion":{"type":"string","enum":["default-relevance-v1","custom","cohere-relevance-v1"],"description":"Only on applied results. TypeSafe/Jev uses default-relevance-v1 or custom; Cohere uses cohere-relevance-v1.","uniqueKey":"rerank.criteriaVersion","typeLabel":"enum\u003cstring>"},"reason":{"type":"string","enum":["noCandidates","timeout","rateLimit","unavailable","invalidResponse","credentials"],"description":"Only for skipped/fallback. skipped uses noCandidates; fallback uses a bounded provider failure reason.","conditionalRequirements":[{"when":[[{"property":"status","values":["skipped"],"matchesAbsent":true}]]},{"when":[[{"property":"status","values":["fallback"],"matchesAbsent":true}]]}],"uniqueKey":"rerank.reason","typeLabel":"enum\u003cstring>"}},"additionalProperties":false,"uniqueKey":"rerank","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"example":{"title":"example","summary":"Example response for documents query","value":{"took":10,"maxScore":1,"total":2,"docs":[{"collection":"example-collection-name","score":1,"doc":{"example-field1":"example-value1","example-field2":[0.1,0.2,0.3]}},{"collection":"example-collection-name","score":0.9,"doc":{"example-field1":"example-value2","example-field2":[0.4,0.5,0.6]}}],"isDocsInline":true}},"nativeReranking":{"title":"nativeReranking","summary":"Applied reranking preserves original search scores","value":{"took":195,"maxScore":0.80000002,"total":2,"docs":[{"collection":"articles","score":0.80000002,"retrievalScore":3.2,"doc":{"id":"restore-guide","title":"Restore a collection version"}},{"collection":"articles","score":0.3,"retrievalScore":4.1,"doc":{"id":"overview","title":"Collection overview"}}],"isDocsInline":true,"rerank":{"status":"applied","provider":"typesafe","model":"jev-1.13.0","candidateCount":2,"scoredCount":2,"took":180,"criteriaVersion":"default-relevance-v1"}}},"customReranking":{"title":"customReranking","summary":"Custom evaluation includes a valid zero score","value":{"took":195,"maxScore":1,"total":2,"docs":[{"collection":"articles","score":1,"retrievalScore":3.2,"doc":{"id":"restore-guide","title":"Restore a collection version"}},{"collection":"articles","score":0,"retrievalScore":4.1,"doc":{"id":"overview","title":"Collection overview"}}],"isDocsInline":true,"rerank":{"status":"applied","provider":"typesafe","model":"jev-1.13.0","candidateCount":2,"scoredCount":2,"took":180,"criteriaVersion":"custom"}}},"emptyReranking":{"title":"emptyReranking","summary":"No candidates; provider not called","value":{"took":3,"total":0,"docs":[],"isDocsInline":true,"rerank":{"status":"skipped","provider":"typesafe","model":"jev-1.13.0","candidateCount":0,"scoredCount":0,"took":0,"reason":"noCandidates"}}},"rerankFallback":{"title":"rerankFallback","summary":"Whole-stage timeout fallback with unchanged search scores","value":{"took":2010,"maxScore":4.1,"total":2,"docs":[{"collection":"articles","score":4.1,"doc":{"id":"overview","title":"Collection overview"}},{"collection":"articles","score":3.2,"doc":{"id":"restore-guide","title":"Restore a collection version"}}],"isDocsInline":true,"rerank":{"status":"fallback","provider":"typesafe","model":"jev-1.13.0","candidateCount":2,"scoredCount":0,"took":2000,"reason":"timeout"}}}},"exampleType":"examples"}},"exampleType":"examples"},"445d2c9e-a7bc-42ce-9087-dfc087bf541f":{"description":"Bad request, including invalid rerank provider/model, fields, criteria, size/candidateSize, sort combination, or query-less/filter-only reranking. Validation and disabled-model errors do not use returnOriginal.","content":{"application/json":{"schema":{"title":"BadRequest","type":"object","properties":{"message":{"type":"string","uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"BadRequest · object"},"examples":{"example":{"title":"example","summary":"Example response for bad request","value":{"message":"Invalid request"}}},"exampleType":"examples"}},"exampleType":"examples"},"45b4afd4-4ce6-4c97-b069-6d02fc92e0d8":{"description":"Unauthenticated","content":{"application/json":{"schema":{"title":"Unauthenticated","type":"object","properties":{"message":{"type":"string","uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"Unauthenticated · object"},"examples":{"example":{"title":"example","summary":"Example response for authentication failure","value":{"message":"Authentication failed"}}},"exampleType":"examples"}},"exampleType":"examples"},"32c71bfb-5dfa-478d-916d-3d20ff4c6c09":{"description":"Project inference quota exceeded. Rerank returnOriginal does not bypass inference quota errors.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"required":["message"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"6cd6e100-e591-464a-b9eb-c7ac0fe55546":{"description":"Resource not found","content":{"application/json":{"schema":{"title":"ResourceNotFound","type":"object","properties":{"message":{"type":"string","uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"ResourceNotFound · object"},"examples":{"example":{"title":"example","summary":"Example response for resource not found","value":{"message":"Resource not found"}}},"exampleType":"examples"}},"exampleType":"examples"},"2b1801f7-b816-4aa4-b26c-6a888658a388":{"description":"Rerank provider timeout with the default error policy. No partial results are returned. Overall query deadline and cancellation are separate errors, not fallback opportunities.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"required":["message"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"7fb213b5-9bbf-4f94-bde9-906df4064d39":{"description":"Request exceeds the Gateway transport limit. Reduce the request size or use bulk upsert when supported.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"required":["message"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"66a42533-0318-4e82-8bd2-ecf17bf60970":{"description":"Too many requests, the pending-write payload exceeds the consistent-read limit, or concurrent facet requests temporarily exhaust a memory budget. Rerank provider-call admission limits also return 429 and do not use returnOriginal.","content":{"application/json":{"schema":{"title":"TooManyRequests","type":"object","properties":{"message":{"type":"string","uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"TooManyRequests · object"},"examples":{"example":{"title":"example","summary":"Example response for too many requests","value":{"message":"Too many requests"}}},"exampleType":"examples"}},"headers":{"Retry-After":{"description":"Optional retry delay in seconds. Not present on every 429 response.","schema":{"type":"string"}}},"exampleType":"examples"},"cd75346e-245c-40d1-a3dd-c3eb760ee8ad":{"description":"Internal server error","content":{"application/json":{"schema":{"title":"InternalServerError","type":"object","properties":{"message":{"type":"string","uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"InternalServerError · object"},"examples":{"example":{"title":"example","summary":"Example response for internal server error","value":{"message":"Internal server error"}}},"exampleType":"examples"}},"exampleType":"examples"},"43b6c9cb-0c36-4fb9-bb16-e391ce2e3b84":{"description":"Unexpected downstream failure. A failed write response may leave its outcome uncertain.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"required":["message"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"54760ff3-8ac6-4f35-be2c-3496a896d1a7":{"description":"Transient catalog or storage dependency failure. Use bounded retries where the operation permits.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"required":["message"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"8bc4075e-156b-44ba-9922-6730eac291f0":{"description":"Gateway request deadline exceeded. A write may have been applied; verify its outcome before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"required":["message"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"8618adf4-1fb2-44fe-b37e-bf1529de56d9":{"ProjectApiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Project API Key.","x-speakeasy-example":"\u003cYOUR_PROJECT_API_KEY>","scopes":[],"schemeName":"ProjectApiKey"}}},"servers":{"7431bbc0-1b39-40d2-b54d-415419b0c4d9":{"url":"https://{projectHost}","description":"LambdaDB API endpoints","variables":{"projectHost":{"description":"The project-scoped URL of the API","default":"api.lambdadb.ai/projects/example-project"}}}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"Project API Key.","x-speakeasy-example":"\u003cYOUR_PROJECT_API_KEY>","scopes":[],"schemeName":"ProjectApiKey"},"schema":{"title":"x-api-key","type":"string","description":"Project API Key.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ProjectApiKey","name":"x-api-key"}],"title":"ProjectApiKey"}]},"originalFileLocation":"reference/api/openapi.json"},"subdomain":"lambdadb","siteName":"LambdaDB Documentation","title":"Query a collection - LambdaDB Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-07T12:21:09.400Z","originalFileLocation":"reference/api/endpoint/document-query.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Search a collection with a query and return the most similar documents. Optionally rerank globally merged candidates with a model provided by LambdaDB before the final size limit. Rerank is configured per query; omitted/null preserves existing behavior. See the Native reranking guide for candidate depth, score meaning, and failure policy.\">\u003cmeta data-mint-head name=\"application-name\" content=\"LambdaDB Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lambdadb/HRGCecHRqLCJVNdR/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/lambdadb/HRGCecHRqLCJVNdR/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lambdadb/HRGCecHRqLCJVNdR/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lambdadb/HRGCecHRqLCJVNdR/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lambdadb/HRGCecHRqLCJVNdR/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lambdadb/HRGCecHRqLCJVNdR/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lambdadb/HRGCecHRqLCJVNdR/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lambdadb/HRGCecHRqLCJVNdR/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lambdadb/HRGCecHRqLCJVNdR/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Query a collection - LambdaDB Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Search a collection with a query and return the most similar documents. Optionally rerank globally merged candidates with a model provided by LambdaDB before the final size limit. Rerank is configured per query; omitted/null preserves existing behavior. See the Native reranking guide for candidate depth, score meaning, and failure policy.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"LambdaDB Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.lambdadb.ai/reference/api/endpoint/document-query\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://lambdadb.mintlify.site/_mintlify/api/og/v2?division=Search\u0026amp;title=Query+a+collection\u0026amp;description=Search+a+collection+with+a+query+and+return+the+most+similar+documents.+Optionally+rerank+globally+merged+candidates+with+a+model+provided+by+LambdaDB+before+th\u0026amp;theme=3cd9b5ccc9d6e8e94ca23c6d\u0026amp;signature=f33efb3fe78875255f5ebd3e8ee493a35bc4b658486c6990ee296fc05df4d692\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Query a collection - LambdaDB Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Search a collection with a query and return the most similar documents. Optionally rerank globally merged candidates with a model provided by LambdaDB before the final size limit. Rerank is configured per query; omitted/null preserves existing behavior. See the Native reranking guide for candidate depth, score meaning, and failure policy.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://lambdadb.mintlify.site/_mintlify/api/og/v2?division=Search\u0026amp;title=Query+a+collection\u0026amp;description=Search+a+collection+with+a+query+and+return+the+most+similar+documents.+Optionally+rerank+globally+merged+candidates+with+a+model+provided+by+LambdaDB+before+th\u0026amp;theme=3cd9b5ccc9d6e8e94ca23c6d\u0026amp;signature=f33efb3fe78875255f5ebd3e8ee493a35bc4b658486c6990ee296fc05df4d692\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/lambdadb/HRGCecHRqLCJVNdR/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"LambdaDB Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9373\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.lambdadb.ai/reference/api/endpoint/document-query\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/reference/api/endpoint/document-query.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.lambdadb.ai/#organization\",\"name\":\"LambdaDB Documentation\",\"url\":\"https://docs.lambdadb.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/lambdadb/fejsT7T9UaNPB1nX/logo/light.svg?fit=max\u0026auto=format\u0026n=fejsT7T9UaNPB1nX\u0026q=85\u0026s=3984578842930966eb2d9d05766af2cd\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.lambdadb.ai#website\",\"name\":\"LambdaDB Documentation\",\"url\":\"https://docs.lambdadb.ai\",\"publisher\":{\"@id\":\"https://docs.lambdadb.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.lambdadb.ai/reference/api/endpoint/document-query#webpage\",\"url\":\"https://docs.lambdadb.ai/reference/api/endpoint/document-query\",\"name\":\"Query a collection\",\"description\":\"Search a collection with a query and return the most similar documents. Optionally rerank globally merged candidates with a model provided by LambdaDB before the final size limit. Rerank is configured per query; omitted/null preserves existing behavior. See the Native reranking guide for candidate depth, score meaning, and failure policy.\",\"dateModified\":\"2026-10-07T12:21:09.400Z\",\"isPartOf\":{\"@id\":\"https://docs.lambdadb.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.lambdadb.ai/reference/api/endpoint/document-query#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.lambdadb.ai/reference/api/endpoint/document-query#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"APIs\",\"item\":\"https://docs.lambdadb.ai/reference/api/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Query a collection\",\"item\":\"https://docs.lambdadb.ai/reference/api/endpoint/document-query\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.lambdadb.ai/reference/api/endpoint/document-query#apireference\",\"headline\":\"Query a collection\",\"name\":\"Query a collection\",\"description\":\"Search a collection with a query and return the most similar documents. Optionally rerank globally merged candidates with a model provided by LambdaDB before the final size limit. Rerank is configured per query; omitted/null preserves existing behavior. See the Native reranking guide for candidate depth, score meaning, and failure policy.\",\"url\":\"https://docs.lambdadb.ai/reference/api/endpoint/document-query\",\"mainEntityOfPage\":{\"@id\":\"https://docs.lambdadb.ai/reference/api/endpoint/document-query#webpage\"},\"dateModified\":\"2026-10-07T12:21:09.400Z\",\"publisher\":{\"@id\":\"https://docs.lambdadb.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.lambdadb.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"LambdaDB Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"LambdaDB Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/reference/api/endpoint/document-query.md","siteName":"LambdaDB Documentation","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/guides/get-started/overview"}]},{"tab":"Reference","groups":[{"group":"APIs","pages":[{"title":"API reference","href":"/reference/api/introduction"},{"group":"Collections","pages":[{"title":"List collections","openapi":"get /collections","href":"/reference/api/endpoint/collection-list"},{"title":"Create a collection","openapi":"post /collections","href":"/reference/api/endpoint/collection-create"},{"title":"Describe a collection","openapi":"get /collections/{collectionName}","href":"/reference/api/endpoint/collection-describe"},{"title":"Delete a collection","openapi":"delete /collections/{collectionName}","href":"/reference/api/endpoint/collection-delete"},{"title":"Configure a collection","openapi":"patch /collections/{collectionName}","href":"/reference/api/endpoint/collection-configure"}]},{"group":"Branches, tags \u0026 aliases","pages":[{"title":"Create a branch","openapi":"post /collections/{collectionName}/branches","href":"/reference/api/endpoint/branch-create"},{"title":"List branches","openapi":"get /collections/{collectionName}/branches","href":"/reference/api/endpoint/branch-list"},{"title":"Delete a branch","openapi":"delete /collections/{collectionName}/branches/{branchName}","href":"/reference/api/endpoint/branch-delete"},{"title":"Create a tag","openapi":"post /collections/{collectionName}/tags","href":"/reference/api/endpoint/tag-create"},{"title":"List tags","openapi":"get /collections/{collectionName}/tags","href":"/reference/api/endpoint/tag-list"},{"title":"Delete a tag","openapi":"delete /collections/{collectionName}/tags/{tagName}","href":"/reference/api/endpoint/tag-delete"},{"title":"Create an alias","openapi":"post /collections/{collectionName}/aliases","href":"/reference/api/endpoint/alias-create"},{"title":"List aliases","openapi":"get /collections/{collectionName}/aliases","href":"/reference/api/endpoint/alias-list"},{"title":"Retarget an alias","openapi":"patch /collections/{collectionName}/aliases/{aliasName}","href":"/reference/api/endpoint/alias-retarget"},{"title":"Delete an alias","openapi":"delete /collections/{collectionName}/aliases/{aliasName}","href":"/reference/api/endpoint/alias-delete"}]},{"group":"Documents","pages":[{"title":"Upsert documents","openapi":"post /collections/{collectionName}/docs/upsert","href":"/reference/api/endpoint/document-upsert"},{"title":"Get bulk upsert URL","openapi":"get /collections/{collectionName}/docs/bulk-upsert","href":"/reference/api/endpoint/document-get-bulk-upsert-url"},{"title":"Bulk upsert documents","openapi":"post /collections/{collectionName}/docs/bulk-upsert","href":"/reference/api/endpoint/document-bulk-upsert"},{"title":"Update documents","openapi":"post /collections/{collectionName}/docs/update","href":"/reference/api/endpoint/document-update"},{"title":"Fetch documents","openapi":"post /collections/{collectionName}/docs/fetch","href":"/reference/api/endpoint/document-fetch"},{"title":"List documents","openapi":"get /collections/{collectionName}/docs","href":"/reference/api/endpoint/document-list"},{"title":"List documents extended","openapi":"post /collections/{collectionName}/docs/list","href":"/reference/api/endpoint/document-list-extended"},{"title":"Delete documents","openapi":"post /collections/{collectionName}/docs/delete","description":"Delete documents by document IDs or query filter from a collection.","href":"/reference/api/endpoint/document-delete"}]},{"group":"Search","pages":[{"title":"Query a collection","openapi":"post /collections/{collectionName}/query","href":"/reference/api/endpoint/document-query"}]}]},{"group":"SDKs and tools","pages":[{"title":"Overview","description":"Explore the official LambdaDB SDKs, CLI, MCP server, and migration tools.","href":"/reference/sdk/introduction"}]}]}]},"basePath":"","title":"Query a collection - LambdaDB Documentation","buildId":"dpl_9RFrWkXdFTJCytfx6jAofvAaEXr6","deploymentId":"dpl_9RFrWkXdFTJCytfx6jAofvAaEXr6","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BgGj2PGS.js","utils-BhNOqRKb.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-BAgRNUZo.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-CGkb0TPw.js","snippetPresets-ChLkL1a6.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-Ef10Jrbx.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-DlVCnjU8.js","shallow-BA55zJxQ.js","getApiPlaygroundDisplay-DR09dKtp.js","CodeSnippet-BZ8J8Kll.js","CodeSnippets-CcguVheG.js","Page-C7x-eUfk.js","getPastedJson-D5UqeqBp.js","icon-DpD0l99C.js","MethodPill-Wg2NXsp_.js","DuplicateIcon-CCSyX8lh.js","createIcon-C4Ukv9HX.js","DynamicMarkdown-RhjEuCHC.js","SectionHeading-DL1MykRq.js","axios-vUo_bRtp.js","Markdown-BwQ4RMdp.js","dist-CiVXVcSh.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","katex-YMM-FMeD.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","AssistantPageLink-Dic2Jtb2.js"]}