is_trained

Returns True if the index has been trained, enabling efficient approximate nearest neighbor search. An untrained index will default to exhaustive search.

def is_trained(self) -> bool

Returns

bool: True if the index has been trained; otherwise, False.

Example Usage

# Check if index is trained
if index.is_trained():
    print("The index is ready for efficient querying.")
else:
    print("The index is not trained; consider calling train().")

index_name

Retrieves the name of the current index.

def index_name(self) -> str

Returns

str: Name of the currently loaded or created index.

Example Usage

# Retrieve the index name
print("Current index name:", index.index_name())

index_type

Returns the type of the current index (e.g., ivf, ivfpq, ivfflat).

def index_type(self) -> str

Returns

Return TypeDescription
strType of the current index.

Example Usage

# Retrieve the type of index
print("Index type:", index.index_type())

index_config

Retrieves the configuration details of the current index.

def index_config(self) -> IndexConfig

Returns

IndexConfig: Dictionary of index configuration parameters.

Example Usage

# Retrieve index config
print("Index configuration:", index.index_config())