Skip to main content
POST
/
v2
/
data
/
search
curl --request POST \
  --url https://api.example.com/v2/data/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "dense": {
    "column": "dense_vector",
    "parameters": {
      "ef_search": 150
    },
    "text": [
      "Create a new trait within your crate."
    ]
  },
  "filter": "id = '100'",
  "projection": "id, text, metadata, distance",
  "search_mode": "dense",
  "top_k": 10
}
EOF
{
  "code": 200,
  "data": {
    "data": [
      [
        {
          "distance": 0.10213412,
          "id": "1",
          "metadata": "{\"file_name\": \"abc.pdf\"}",
          "text": "hello"
        },
        {
          "distance": 0.20213412,
          "id": "2",
          "metadata": "{\"file_name\": \"def.pdf\"}",
          "text": "world"
        },
        {
          "distance": 0.30213412,
          "id": "3",
          "metadata": "{\"file_name\": \"ghi.pdf\"}",
          "text": "rust"
        }
      ],
      [
        {
          "distance": 0.15223412,
          "id": "4",
          "metadata": "{\"file_name\": \"jkl.pdf\"}",
          "text": "python"
        },
        {
          "distance": 0.25223412,
          "id": "5",
          "metadata": "{\"file_name\": \"mno.pdf\"}",
          "text": "java"
        },
        {
          "distance": 0.35223412,
          "id": "6",
          "metadata": "{\"file_name\": \"pqr.pdf\"}",
          "text": "go"
        }
      ]
    ],
    "metrics": null,
    "num_resultsets": 2,
    "schema": {
      "fields": [
        {
          "data_type": "LargeUtf8",
          "name": "id",
          "nullable": false
        },
        {
          "data_type": "LargeUtf8",
          "name": "metadata",
          "nullable": false
        },
        {
          "data_type": "LargeUtf8",
          "name": "text",
          "nullable": false
        },
        {
          "data_type": "Float32",
          "name": "distance",
          "nullable": false
        }
      ],
      "metadata": {}
    }
  },
  "exception": null,
  "success": true
}

Authorizations

Authorization
string
header
required

Bearer token authentication. Include the token in the Authorization header as 'Bearer '

Query Parameters

include_metrics
boolean

Include metrics in the response. Default is false.

Body

application/json

Search request supporting dense/sparse modes with vector or text queries

search_mode
enum<string>
required

Search mode to use

Available options:
dense,
sparse,
hybrid
top_k
integer<int32>
required

Number of top results to return from the hybrid search. Must be greater than 0.

Example:

"100"

dense
object

Dense vector search configuration

filter
string | null
default:""

SQL WHERE clause to filter the results. If not specified, no filtering will be applied.

Example:

"id < 1000"

fusion
object

Fusion configuration for combining results

projection
string | null
default:*

Columns to include in the result set. Uses SQL projection syntax (e.g. "col1, col2"). If not specified, all columns will be returned.

Example:

"id, name"

sparse
object

Sparse vector search configuration

Response

Successfully performed search

code
integer<int32>
required

HTTP status code.

Required range: x >= 0
success
boolean
required

Whether the request was successful.

data
object
exception
object