Skip to main content

Drop non-linear index

Remove a non-linear index (HNSW) from a store.

Every operation works on both Vector DB stores (you supply raw vectors) and AI stores (you supply text or images and Ahnlich AI generates the embeddings for you). Use the Vector DB / AI switch in the sample below.

Parameters

ParameterTypeDescription
storestringStore to modify.
non_linear_indiceslistThe index types to drop.
schemastring · optionalSchema to target. Defaults to public.

All requests accept an optional schema field. When omitted, the server uses the public schema.

Behavior

  • Deletes the index only — stored vectors and metadata are untouched.
  • Similarity search still works, falling back to a linear scan.

Sample query

Python
import asyncio
from grpclib.client import Channel
from ahnlich_client_py.grpc.services.db_service import DbServiceStub
from ahnlich_client_py.grpc.db import query as db_query
from ahnlich_client_py.grpc.algorithm.nonlinear import NonLinearAlgorithm


async def drop_non_linear_algo():
async with Channel(host="127.0.0.1", port=1369) as channel:
client = DbServiceStub(channel)

response = await client.drop_non_linear_algorithm_index(
db_query.DropNonLinearAlgorithmIndex(
store="my_store",
schema="analytics",
non_linear_indices=[NonLinearAlgorithm.HNSW],
error_if_not_exists=True
)
)
# response.deleted_count shows how many indexes were removed
print(response)


if __name__ == "__main__":
asyncio.run(drop_non_linear_algo())

Response

The number of indexes deleted.