Skip to main content
POST
/
api
/
v1
/
vector
/
search
Search for nearest neighbors
curl --request POST \
  --url http://localhost:8080/api/v1/vector/search \
  --header 'Content-Type: application/protobuf+json' \
  --data '
{
  "vector": [
    123
  ],
  "k": 2,
  "nprobe": 123,
  "filter": {
    "and": "<array>",
    "or": "<array>"
  },
  "includeFields": [
    "<string>"
  ]
}
'
{
  "status": "success",
  "results": [
    {
      "score": 0.05,
      "vector": {
        "id": "doc-1",
        "attributes": {
          "vector": [
            1,
            2,
            3
          ],
          "category": "electronics"
        }
      }
    }
  ]
}

Body

Request body for searching nearest neighbors.

vector
number<float>[]
required

Query vector. Must have the same number of dimensions as the collection.

k
integer<uint32>
required

Number of nearest neighbors to return.

Required range: x >= 1
nprobe
integer<uint32>

Number of posting lists to search. Higher values improve recall at the cost of latency. Optional.

filter
object

A filter expression. Each filter object must contain exactly one operator key. Filters can be nested using and and or.

includeFields
string[]

List of attribute field names to include in results. When omitted, all attributes are returned.

Response

Search results ranked by similarity.

Response containing search results ranked by similarity.

status
string
required
Example:

"success"

results
object[]
required