Table
Index
Metadata

Create an index on a table

Create an index on a table column 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

idstring[]
columnstring required

Name of the column to create index on

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",
  "index_type": "index_type",
  "with_position": true,
  "lower_case": true,
  "distance_type": "distance_type",
  "name": "name",
  "ascii_folding": true,
  "id": [
    "id",
    "id"
  ],
  "remove_stop_words": true,
  "stem": true
}

Response

Index created successfully

transaction_idstring

Optional transaction identifier

Example response

{
  "transaction_id": "transaction_id"
}

Changes