v52

latestOpenAPI 3.1.1Apache 2.0raw.githubusercontent.com2026-08-0354155395.9 KB
Table
Index
Metadata

Create an index on a table

Create an index on a table field for faster search operations. Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.). Index creation is handled asynchronously. Use the ListTableIndices and DescribeTableIndexStats operations to monitor index creation progress.

post/v1/table/{id}/create_index

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

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

Request body

{"stackTrail":"components:schemas:CreateTableIndexRequest:properties:context","oasType":"schema","type":"unknown","description":"Arbitrary context as key-value pairs.\nHow to use the context is custom to the specific implementation.\n\nOn a request, it carries caller-provided context to the implementation.\nOn a response, it carries implementation-provided context back to the caller.\n\nREST NAMESPACE ONLY\nContext entries are mapped to and from HTTP headers using the `header.` prefix:\n- On a request, any entry whose key starts with `header.` is sent as an HTTP\n request header with the prefix stripped. For example, the entry\n `{\"header.Authorization\": \"Bearer abc\"}` is sent as the request header\n `Authorization: Bearer abc`.\n- On a response, every HTTP response header is returned as an entry whose key is the\n header name prefixed with `header.`. For example, the response header\n `x-request-id: abc123` is returned as the entry `{\"header.x-request-id\": \"abc123\"}`.\n"}
idstring[]
branchstring

Branch to target. When not specified, the main branch is used.

columnstring required

Lance field path to create the index on. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound.

index_typestring required

Type of index to create (e.g., BTREE, BITMAP, LABEL_LIST, IVF_FLAT, IVF_PQ, IVF_HNSW_SQ, FTS)

namestring nullable

Optional name for the index. If not provided, a name will be auto-generated.

distance_typestring

Distance metric type for vector indexes (e.g., l2, cosine, dot)

with_positionboolean nullable

Optional FTS parameter for position tracking

base_tokenizerstring nullable

Optional FTS parameter for base tokenizer

languagestring nullable

Optional FTS parameter for language

max_token_lengthinteger nullable

Optional FTS parameter for maximum token length

lower_caseboolean nullable

Optional FTS parameter for lowercase conversion

stemboolean nullable

Optional FTS parameter for stemming

remove_stop_wordsboolean nullable

Optional FTS parameter for stop word removal

ascii_foldingboolean nullable

Optional FTS parameter for ASCII folding

Example request

{
  "base_tokenizer": "base_tokenizer",
  "column": "column",
  "max_token_length": 0,
  "language": "language",
  "branch": "branch",
  "index_type": "index_type",
  "with_position": true,
  "lower_case": true,
  "distance_type": "distance_type",
  "identity": {
    "api_key": "api_key",
    "auth_token": "auth_token"
  },
  "context": {
    "key": "context"
  },
  "name": "name",
  "ascii_folding": true,
  "id": [
    "id",
    "id"
  ],
  "remove_stop_words": true,
  "stem": true
}

Response

Index created successfully

{"stackTrail":"components:schemas:CreateTableIndexResponse:properties:context","oasType":"schema","type":"unknown","description":"Arbitrary context as key-value pairs.\nHow to use the context is custom to the specific implementation.\n\nOn a request, it carries caller-provided context to the implementation.\nOn a response, it carries implementation-provided context back to the caller.\n\nREST NAMESPACE ONLY\nContext entries are mapped to and from HTTP headers using the `header.` prefix:\n- On a request, any entry whose key starts with `header.` is sent as an HTTP\n request header with the prefix stripped. For example, the entry\n `{\"header.Authorization\": \"Bearer abc\"}` is sent as the request header\n `Authorization: Bearer abc`.\n- On a response, every HTTP response header is returned as an entry whose key is the\n header name prefixed with `header.`. For example, the response header\n `x-request-id: abc123` is returned as the entry `{\"header.x-request-id\": \"abc123\"}`.\n"}
transaction_idstring

Optional transaction identifier

Example response

{
  "transaction_id": "transaction_id",
  "context": {
    "key": "context"
  }
}