hey,
I’m trying to follow along with the tutorial in the documentation using the python client and I’m getting an unexpected error.
First, I created a collection with non-default hnsw configuration, like this:
client.collections.create(
"Article0",
vector_index_config=Configure.VectorIndex.hnsw(ef=123),
properties=[
Property(name="title", data_type=DataType.TEXT),
Property(name="body", data_type=DataType.TEXT),
],
)
this seems to work fine.
Then, I created another collection with multiple named vectors, like this:
client.collections.create(
"Article1",
vectorizer_config=[
Configure.NamedVectors.none(name="vector_1"),
Configure.NamedVectors.none(name="vector_2")
],
properties=[
Property(name="title", data_type=DataType.TEXT),
Property(name="body", data_type=DataType.TEXT),
],
)
this also worked fine.
However, when I tried to make a single collection with both specifications:
client.collections.create(
"Article2",
vector_index_config=Configure.VectorIndex.hnsw(ef=123),
vectorizer_config=[Configure.NamedVectors.none(name="vector_1"),
Configure.NamedVectors.none(name="vector_2")],
properties=[
Property(name="title", data_type=DataType.TEXT),
Property(name="body", data_type=DataType.TEXT),
],
)
I got an error:
UnexpectedStatusCodeError: Collection may not have been created properly.! Unexpected status code: 422, with response body: {'error': [{'message': 'class.vectorIndexType "hnsw" can not be set if class.vectorConfig is configured'}]}.
What am I doing wrong? I tried some workaround (such as changed hnsw default after creating the collection), but no luck either. The error itself is a bit curious, because in the second collection (Article1
), the vector_index_config is by default hnsw, just with a different ef value.
thanks for the help!