[Question] Named Vectors with non-default hnsw

Hi @Omer_Elinav !

Welcome to our community! :hugs:

Indeed this is not possible. Because you are defining named vectors, the index configuration is now a “per named vector basis” and not on a collection basis.

With that said, this is the correct way to “tweak” a named vector index configuration:

from weaviate import classes as wvc
client.collections.delete("Test")
client.collections.create(
    "Test",
    vectorizer_config=[
        wvc.config.Configure.NamedVectors.none(
            name="vector_1"
        ),
        wvc.config.Configure.NamedVectors.none(
            name="vector_2", 
            vector_index_config=wvc.config.Configure.VectorIndex.hnsw(ef=123)
        )
    ],
    properties=[
        wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT),
        wvc.config.Property(name="body", data_type=wvc.config.DataType.TEXT),
    ],
)

Let me know if that helps!

Thanks!

Let me know if that helps! Thanks!

2 Likes