Description
I have been trying to create a named vector collection.
with the below configuration
multi_vector_test = client.collections.create(
name="Multi_vector_test",
properties=[
wvc.config.Property(
name="data",
data_type=wvc.config.DataType.TEXT,
vectorize_property_name=False,
tokenization=wvc.config.Tokenization.FIELD,
),
wvc.config.Property(
name="vec1",
data_type=wvc.config.DataType.TEXT,
vectorize_property_name=False,
tokenization=wvc.config.Tokenization.FIELD,
),
wvc.config.Property(
name="vec2",
data_type=wvc.config.DataType.TEXT,
vectorize_property_name=False,
tokenization=wvc.config.Tokenization.FIELD,
),
],
vector_config=[
Configure.Vectors.text2vec_azure_openai(
name="default",
source_properties=["data"],
resource_name=AZURE_OPENAI_EMBEDDING_RESOURCE_NAME,
deployment_id=AZURE_OPENAI_EMBEDDING_DEPLOYMENT_ID,
base_url=AZURE_OPENAI_ENDPOINT,
vectorize_collection_name=False,
),
Configure.Vectors.text2vec_azure_openai(
name="vec1",
source_properties=["vec1"],
resource_name=AZURE_OPENAI_EMBEDDING_RESOURCE_NAME,
deployment_id=AZURE_OPENAI_EMBEDDING_DEPLOYMENT_ID,
base_url=AZURE_OPENAI_ENDPOINT,
vectorize_collection_name=False,
)
],
)
And have added one document in it
added_doc = multi_vector_test.data.insert({"data": "test 1"})
multi_vector_test.query.fetch_object_by_id(added_doc).properties
# OUTPUT
{'vec1': None, 'vec2': None, 'data': 'test 1'}
When queried with vec1 vector the output should be empty as the doc i inserted had vec1 property as None. But a doc is retrieved and its distance and certainty are shown as distance=0.6095870733261108, certainty=0.6952064633369446
docs = multi_vector_test.query.near_text(query="test", target_vector="vec1", return_metadata=["certainty", "distance"])
print(docs.objects[0])
## OUTPUT
Object(uuid=_WeaviateUUIDInt('831905db-9a32-475d-8e6c-47868c918543'), metadata=MetadataReturn(creation_time=None, last_update_time=None, distance=0.6095870733261108, certainty=0.6952064633369446, score=None, explain_score=None, is_consistent=None, rerank_score=None), properties={'vec1': None, 'vec2': None, 'data': 'test 1'}, references=None, vector={}, collection='Multi_vector_test')
Why does this happen? am i doing something wrong
Server Setup Information
- Weaviate Server Version: semitechnologies/weaviate:1.27.27
- Deployment Method: Docker
- Multi Node? Number of Running Nodes: 1
- Client Language and Version: python 4.16.10