Recreate the vector index with COSINE distance
Use this to fix an existing index that was created with wrong distance metric. This will drop the existing index and recreate it with COSINE distance.
WARNING: This may take time if you have many embeddings, as the index needs to be rebuilt.
Embedding vector dimensions (default: 1536 for text-embedding-3-small)
import { recreate_index } from './database';await recreate_index(1536); Copy
import { recreate_index } from './database';await recreate_index(1536);
Recreate the vector index with COSINE distance
Use this to fix an existing index that was created with wrong distance metric. This will drop the existing index and recreate it with COSINE distance.
WARNING: This may take time if you have many embeddings, as the index needs to be rebuilt.