if not client.collection_exists(collection_name=COLLECTION_NAME):
client.create_collection(
collection_name=COLLECTION_NAME,
optimizers_config=models.OptimizersConfigDiff(indexing_threshold=0,),
hnsw_config=models.HnswConfigDiff(on_disk=True),
vectors_config={
"text-dense": models.VectorParams(
size=3072,
distance=models.Distance.COSINE,
)
},
sparse_vectors_config={
"text-sparse": models.SparseVectorParams(
index=models.SparseIndexParams()
)
},
)
Remove this code. The vector store handles it for you for new collections