Table

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) and scalar indexes.

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.

Request body

namestring required

The table name

namespacestring[] required

The namespace identifier

columnstring required

Name of the column to create index on

index_type'BTREE' | 'BITMAP' | 'LABEL_LIST' | 'IVF_FLAT' | 'IVF_HNSW_SQ' | 'IVF_PQ' | '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

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

Response

Index created successfully

namestring required

The table name

namespacestring[] required

The namespace identifier

locationstring required

Table location (usually empty)

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

Example response

{
  "name": "name",
  "namespace": [
    "namespace",
    "namespace"
  ],
  "location": "location",
  "properties": {
    "key": "properties"
  }
}

Changes