Skip to content

SearchIndex

Source: src/Cloudflare/Vectorize/SearchIndex.ts

Bind a {@link Index} to a Worker and obtain the Effect-native Vectorize client (describe, query, upsert, …).

SearchIndex is a single identifier that is simultaneously the binding’s Context tag, its type, and the callable — yield* Cloudflare.Vectorize.SearchIndex(index).

const vec = yield* Cloudflare.Vectorize.SearchIndex(MyIndex);
const matches = yield* vec.query([0.1, 0.2, 0.3], { topK: 5 });