POST
/
collections
/
{collectionName}
/
query
cURL
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
        ]
      }
    }
  ]
}

Authorizations

x-api-key
string
header
required

Project API Key.

Path Parameters

collectionName
string
required

Collection name.

Body

application/json
query
object
required

Query object.

size
integer

Number of documents to return. Note that the maximum number of documents is 100.

consistentRead
boolean
default:false

If your application requires a strongly consistent read, set consistentRead to true. Although a strongly consistent read might take more time than an eventually consistent read, it always returns the last updated value.

includeVectors
boolean
default:false

If your application need to include vector values in the response, set includeVectors to true.

sort
object[]

List of field name, sort direction pairs.

fields
string[]

List of field name to include in results

Response

Documents selected by query.

took
integer
required

Elapsed time in milliseconds.

total
integer
required

Total number of documents returned.

docs
object[]
required

List of documents.

maxScore
number

Maximum score.