0

I have an issue within Reference filters, I have nested objects within the data:

{
  "name" : "Zach",
  "car" : [
    {
      "make" : "Saturn",
      "model" : "SL"
    },
    {
      "make" : "Suba",
      "model" : "Imprezza"
    }
  ]
}
{
  "name" : "Bob",
  "car" : [
    {
      "make" : "Saturn",
      "model" : "Imprezza"
    }
  ]
}

When I want to get objects having care_make "Saturn" and car_model "Imprezza", I end up getting both objects when making reference calls to car class, while I should get only the second object (which name is "Bob")

Query I m using:

where: {
    operator: And,
    operands: [
      {path: ["car", "Car_class", "make"],
      operator: Equal,
      valueText: "Saturn"},
      {path: ["car", "Car_class", "model"],
      operator: Equal,
      valueText: "Imprezza"}
    ]
  }
  • Are you using cross-references? – Bob van Luijt Nov 30 '22 at 13:53
  • Yes, I have Car_class where having car objects, and Main_class in which I m referring to Car_class to get the nested car objects, For instance, when I try to filter just within Car_class I get the right objects, but when doing reference filter from Main_class I get this issue – zakaria hamdane Nov 30 '22 at 19:17

1 Answers1

1

The current behavior is expected because:

The query is asking for an object that fulfils two conditions:

  • Has an outgoing ref to a car with make Saturn, and
  • has an outgoing ref to a car with model Imprezza

Both objects fulfil these criteria, so the results should be both objects, not just the second.

That said, we have an issue to change this behaviour what you expected:

https://github.com/semi-technologies/weaviate/issues/2477

Please upvote so we can prfioritize accordingly.

hsm207
  • 471
  • 2
  • 4