Description
python client v4
eg I have a Document class, and I want references to:
- project
- client
- task
A doc can link to a single project, and a single client, but multiple tasks.
Questions:
- is the usage of list[ReferenceProperty] correct?
- what’s the difference between
list[ReferenceProperty]and_ReferencePropertyMultiTarget? (in other words when to use_ReferencePropertyMultiTarget?) - when I filter by the referenced task’s properties, and there are multiple tasks linked, will it return docs as long as at least 1 task fulfills the filter criteria? (any vs all)
documents.query.fetch_objects(
return_properties=["heading", "content"],
filters=Filter.by_ref(link_on="task")
.by_property("task_type")
.equal("creative"),
)
simplified schema defined below:
client.collections.create(
name=DOC_NAME,
description="Document",
inverted_index_config=Configure.inverted_index(
index_null_state=True,
index_property_length=True,
),
multi_tenancy_config=Configure.multi_tenancy(True),
Property(
name="title",
data_type=DataType.TEXT,
description="Document title",
),
Property(
name="content",
data_type=DataType.TEXT,
description="Content of the document",
)
],
references=[
ReferenceProperty(name="project", target_collection=PROJECT_NAME),
ReferenceProperty(name="client", target_collection=CLIENT_NAME),
ReferenceProperty(name="task", target_collection=TASK_NAME),
],
)
Server Setup Information
- Weaviate Server Version: latest
- Deployment Method: cloud
- Multi Node? Number of Running Nodes: 1
- Client Language and Version: eng, latest