Skip to main content
POST
/
projects
/
{projectId}
/
indexes
/
{indexName}
/
query
cURL
curl --request POST \
  --url https://{baseUrl}/{version}/projects/{projectId}/indexes/{indexName}/query \
  --header 'content-type: <content-type>' \
  --header 'x-api-key: <x-api-key>' \
  --data '{
  "size": 123,
  "query": {},
  "consistentRead": false,
  "includeVectors": false,
  "sort": [
    {}
  ],
  "trackScores": false
}'
{
  "took": 123,
  "maxScore": 123,
  "total": 123,
  "docs": [
    {
      "index": "<string>",
      "score": 123,
      "doc": {}
    }
  ]
}

Headers

content-type
string
default:application/json
required
x-api-key
string
required

Project API Key.

Path Parameters

projectId
string
required

Project ID.

indexName
string
required

Index name.

Body

application/json
size
integer
required

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

query
object

Query object.

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.

trackScores
boolean
default:false

If your application needs to track scores with sorting, set trackScores to true.

Response

200 - application/json

Documents selected by query.

took
integer

Elapsed time in milliseconds.

maxScore
number

Maximum score.

total
integer

Total number of documents returned.

docs
object[]

List of documents.