Table
Data

Query a table

Query a table with vector search, full text search and optional SQL filtering. Returns results in Arrow IPC file or stream format.

post/v1/table/{id}/query

Path parameters

idstring required

string identifier of an object in a namespace, following the Lance Namespace spec. When the value is equal to the delimiter, it represents the root namespace. For example, v1/namespace/./list performs a ListNamespace on the root namespace.

Query parameters

delimiterstring nullable

An opaque token that allows pagination for list APIs (e.g. ListNamespaces). For an initial client request for a list API, if the server cannot return all items in one response, or if there are more items than the pageSize specified in the client request, the server must return a nextPageToken in the response indicating there are more results available. After the initial request, the value of nextPageToken from each response must be used by the client as the pageToken parameter value for the next request. Clients must interpret either null, missing value or empty string value of nextPageToken from a server response as the end of the listing results.

An optional delimiter of the string identifier, following the Lance Namespace spec. When not specified, the . delimiter must be used.

Request body

namestring required
namespacestring[] required
bypass_vector_indexboolean nullable

Whether to bypass vector index

columnsstring[] nullable

Optional list of columns to return

distance_typestring nullable

Distance metric to use

efinteger nullable

Search effort parameter for HNSW index

fast_searchboolean nullable

Whether to use fast search

filterstring nullable

Optional SQL filter expression

kinteger required

Number of results to return

lower_boundnumber float nullable

Lower bound for search

nprobesinteger nullable

Number of probes for IVF index

offsetinteger nullable

Number of results to skip

prefilterboolean nullable

Whether to apply filtering before vector search

refine_factorinteger nullable

Refine factor for search

upper_boundnumber float nullable

Upper bound for search

vector_columnstring nullable

Name of the vector column to search

versioninteger nullable

Table version to query

with_row_idboolean nullable

If true, return the row id as a column called _rowid

Example request

{
  "ef": 0,
  "offset": 0,
  "columns": [
    "columns",
    "columns"
  ],
  "vector_column": "vector_column",
  "fast_search": true,
  "k": 0,
  "upper_bound": 1.2315135,
  "version": 0,
  "with_row_id": true,
  "prefilter": true,
  "filter": "filter",
  "refine_factor": 0,
  "full_text_query": {
    "string_query": {
      "columns": [
        "columns",
        "columns"
      ],
      "query": "query"
    },
    "structured_query": {
      "query": {
        "boolean": {
          "must_not": [
            null,
            null
          ],
          "should": [
            null,
            null
          ],
          "must": [
            null,
            null
          ]
        },
        "phrase": {
          "terms": "terms",
          "column": "column",
          "slop": 0
        },
        "match": {
          "fuzziness": 0,
          "terms": "terms",
          "column": "column",
          "boost": 6.0274563,
          "prefix_length": 0,
          "operator": "And",
          "max_expansions": 0
        },
        "boost": {
          "negative": null,
          "negative_boost": 7.0614014,
          "positive": null
        },
        "multi_match": {
          "match_queries": [
            {
              "fuzziness": 0,
              "terms": "terms",
              "column": "column",
              "boost": 6.0274563,
              "prefix_length": 0,
              "operator": "And",
              "max_expansions": 0
            },
            {
              "fuzziness": 0,
              "terms": "terms",
              "column": "column",
              "boost": 6.0274563,
              "prefix_length": 0,
              "operator": "And",
              "max_expansions": 0
            }
          ]
        }
      }
    }
  },
  "distance_type": "distance_type",
  "lower_bound": 3.6160767,
  "bypass_vector_index": true,
  "nprobes": 0,
  "name": "name",
  "namespace": [
    "namespace",
    "namespace"
  ],
  "vector": {
    "single_vector": [
      1.0246457,
      1.0246457
    ],
    "multi_vector": [
      [
        1.4894159,
        1.4894159
      ],
      [
        1.4894159,
        1.4894159
      ]
    ]
  }
}

Response

Query results in Arrow IPC file or stream format

Changes