It is for an e-commerce use case.
We sell products and products have different properties depending on the city, e.g. price, availability etc.. When we query for a product, we always want to filter with a city and only want to return information for that city.
Within Weaviate I built 2 classes City and Product.
class Product:
brand: string
picture: string
cities: List[city]
class City:
cityId: String
additionalInfo: String
I can't seem to find a way to query Weaviate so that it returns only the reference/data to the single matching city. Instead, it returns the product and information for all cities. Below is the query I am using.
{
Get {
Product(
where: {
operator: And
operands: [
{
path: ["cities", "City", "cityId"]
operator: Equal
valueString: "12121"
}
{ path: ["brand"], operator: Equal, valueString: "Goro" }
]
}
nearVector: { vector: [1, 1, 1, 1] }
) {
sku
responseBody
cities {
... on City {
CityId
additionalInfo
}
}
}
}
}
Can someone suggest a way that I could improve on the query to return only a single city? If this is not possible, could someone suggest a better schema to achieve what I am looking for?