curl --request POST \
--url https://{projectHost}/collections/{collectionName}/query \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"size": 2,
"query": {
"queryString": {
"query": "example-field1:example-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
}{
"message": "Invalid request"
}{
"message": "Authentication failed"
}{
"message": "Resource not found"
}{
"message": "<string>"
}{
"message": "Too many requests"
}{
"message": "Internal server error"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Query a collection
Search a collection with a query and return the most similar documents.
curl --request POST \
--url https://{projectHost}/collections/{collectionName}/query \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"size": 2,
"query": {
"queryString": {
"query": "example-field1:example-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
}{
"message": "Invalid request"
}{
"message": "Authentication failed"
}{
"message": "Resource not found"
}{
"message": "<string>"
}{
"message": "Too many requests"
}{
"message": "Internal server error"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Project API Key.
Path Parameters
Collection name.
Body
Number of documents to return, from 0 to 100. Defaults to 10 when omitted or null. Zero requires at least one facet; facet counts cover all matching documents regardless of this size.
0 <= x <= 100Query object. For managed embedding vector fields, use knn.queryText. For unmanaged vector fields, use knn.queryVector. 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.
Overlay eligible pending writes on a directly selected branch's committed data. Defaults to false. Tag and alias reads reject true. Pending bulk imports are excluded. Returns 429 if the pending payload exceeds the consistent-read limit.
If your application need to include vector values in the response, set includeVectors to true.
List of field name, sort direction pairs.
An object to specify a list of field names to include and/or exclude in the result.
- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Read ref selector. A ref that does not exist returns 404 ResourceNotFound; an alias whose target is dangling returns 400 BadRequest.
Show child attributes
Show child attributes
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. Requires a collection created with facet support. Existing collections retain their previous read/write behavior and return 400 for facet requests; reindex into a new collection to use facets. 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
Show child attributes
Response
Documents selected by query.
Elapsed time in milliseconds.
Total number of documents returned.
List of documents.
Show child attributes
Show child attributes
Whether docs are included inline. When false, docs is empty and the result items must be downloaded from docsUrl.
Highest score among returned documents. Omitted when no returned document has a computed score.
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.
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
Show child attributes
Was this page helpful?