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 nullable

An opaque token that allows pagination for list operations (e.g. ListNamespaces).

For an initial request of a list operation, if the implementation cannot return all items in one response, or if there are more items than the page limit specified in the request, the implementation must return a page token in the response, indicating there are more results available.

After the initial request, the value of the page token from each response must be used as the page token value for the next request.

Caller must interpret either null, missing value or empty string value of the page token from the implementation's 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

idstring[]
columnstring required

Name of the column to create index on

index_type'BTREE' | 'BITMAP' | 'LABEL_LIST' | 'IVF_FLAT' | 'IVF_PQ' | 'IVF_HNSW_SQ' | 'FTS' required

Type of index to create

metric_type'l2' | 'cosine' | 'dot' nullable

Distance metric type for vector indexes

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

{
  "with_position": true,
  "lower_case": true,
  "base_tokenizer": "base_tokenizer",
  "column": "column",
  "metric_type": "l2",
  "max_token_length": 0,
  "ascii_folding": true,
  "language": "language",
  "id": [
    "id",
    "id"
  ],
  "remove_stop_words": true,
  "index_type": "BTREE",
  "stem": true
}

Response

Index created successfully

idstring[]
locationstring required

Table location (usually empty)

{"stackTrail":"components:schemas:CreateTableIndexResponse:properties:properties","oasType":"schema","type":"unknown","description":"Additional properties (usually empty)"}

Example response

{
  "location": "location",
  "id": [
    "id",
    "id"
  ],
  "properties": {
    "key": "properties"
  }
}

Changes