Skip to main content

Drop Predicate Index

Removes an existing predicate index from an AI store.

Click to expand source code
import { createAiClient } from "ahnlich-client-node";
import { DropPredIndex } from "ahnlich-client-node/grpc/ai/query_pb";

async function dropPredicateIndex() {
const client = createAiClient("127.0.0.1:1370");

await client.dropPredIndex(
new DropPredIndex({
store: "ai_store",
predicates: ["brand"],
errorIfNotExists: true,
})
);

console.log("Predicate index dropped");
}

dropPredicateIndex();

Parameters​

ParameterTypeRequiredDescription
storestringYesThe name of the AI store
predicatesstring[]YesList of predicate indices to remove
errorIfNotExistsbooleanNoIf true, throws error if index doesn't exist