If I want to query multiple collections, there is a way, but it will be multiple queries with multiple results. What I am looking for is a way to query multiple sets of content (separated either by class property or tenancy) in a single query with a single set of results.
For example, I separate my datasets using the class property “baseSite”. So, what are some strategies for executing neartext queries that will, within one query, search both baseSite = A or baseSite = B? I already know I can probably just use a modified filter on baseSite (Equal A or B), but any other suggestions?
That’s right. You will do X queries if you want to search in X differente collections.
Now, for normalizing those different queries into one single score, you will probably want to rerank those objects all together.
And right now, I don’t see a way of doing that directly from Weaviate.
The reranker we have in place, will only do it for the objects of the queried collection.
Regarding the example of your dataset, I believe it will depend on your business logic and scale.
For example, if each baseSite is a customer, and later on you need to drop that customer and they do not have any relation with each other, having all that data in the same collection will be an expensive operation, because now you are deleting, on top of not having data isolation.
Having multiple collections per customer is also not a scalable solution, and will not allow you to “turn off” a tenant, for example.
In that scenario, multi tenancy is. recommended.
Now, if you need those objects in the same collection so you can search them separately or not, you could store everything in the same collection.
The datasets are content based, not customer based. They can be within the same collection. Let’s even say they share the same class and property names. What separates them logically is the property baseSite. So I need one query to be able to search multiple datasets.
Given that, what are my options for one query searching multiple datasets and returning one set of responses?
Not totally sure if that fits your usecase, but you can search multiple target vectors at once and combine the results: Multiple target vectors | Weaviate