In the documentation, in order to retrieve tenant from the collection, you need the exact tenant name, which in this case is “tenantA”:
import weaviate.classes as wvc
multi_collection = client.collections.get("MultiTenancyCollection")
# Get collection specific to the required tenant
multi_tenantA = multi_collection.with_tenant("tenantA")
# Query tenantA
result = multi_tenantA.query.fetch_objects(
limit=2,
)
print(result.objects[0].properties)
What if I am letting the user input a piece of text and they input “tenant a” instead of “tenantA”? Is there a way to extract the tenant based on the tenant with the closest vector similarity?
Let me give an overview of what I am storing. So in my DB, I am storing multiple maps, each with a distinct name inputted by the user (i.e. “outdoor playground”). Each map stores multiple things: key coordinates in the form of {coordinate name: coordinate} (i.e. “kitchen”: (0.4, 12.5, -34.1)) and also a graph data structure defined in python. I want the user to be able to query and retrieve a map based on vector similarity, so if they input “playground” then it should retrieve the “outdoor playground” map. Also, I’m actually not sure if storing python objects is possible in the database… Can someone please help me with this?