On remote tables, `create_index` returns as soon as the build is scheduled. Until it finishes, a vector index is missing from `list_indices`, a scalar or FTS index shows 0 indexed rows, and queries don't use the index. The docs didn't say any of this, so it was easy to assume the index was ready. This adds that to the `create_index` and `list_indices` docs in Python (`Table` and `AsyncTable`) and TypeScript, and points to `wait_timeout` / `waitTimeoutSeconds`, `wait_for_index`, and `create_index_async` for blocking until the index is ready. It also explains that completion tracking is tied to the submitted build only when the server returns a job ID, while legacy name-based waits can return early when replacing an existing index. Closes #4405
1.7 KiB
@lancedb/lancedb • Docs
@lancedb/lancedb / IndexOptions
Interface: IndexOptions
Properties
config?
optional config: Index;
Advanced index configuration
This option allows you to specify a specific index to create and also allows you to pass in configuration for training the index.
See the static methods on Index for details on the various index types.
If this is not supplied then column data type(s) and column statistics will be used to determine the most useful kind of index to create.
name?
optional name: string;
Optional custom name for the index.
If not provided, a default name will be generated based on the column name.
replace?
optional replace: boolean;
Whether to replace the existing index
If this is false, and another index already exists on the same columns and the same name, then an error will be returned. This is true even if that index is out of date.
The default is true
train?
optional train: boolean;
Whether to train the index with existing data.
If true (default), the index will be trained with existing data in the table. If false, the index will be created empty and populated as new data is added.
Note: This option is only supported for scalar indices. Vector indices always train.
waitTimeoutSeconds?
optional waitTimeoutSeconds: number;
Timeout in seconds to wait for index creation to complete.
Only applies to LanceDB Enterprise tables, which build the index in the
background.
If not specified, createIndex returns once the build is scheduled.
LanceDB Embedded tables always build the index before createIndex returns.