How to define sub selection in query?

Hi again, still trying to work with nested objects.

TLDR: We try to query using .with_where additional filter on nested object property, but apparently we don’t know how to address the nested prop properl.

Details:

Using:

  • Weaviate 1.22.3,
  • Python Weaviate Client 3.25.3

I have defined a nested object in Question schema:

"properties": [
   {
  "dataType": [
    "object"
  ],
  "description": "Property with persistent data, that need to be copied over to the new version of the page.",
  "indexFilterable": True,
  "indexSearchable": True,
  "name": "persistent_data",
  "nestedProperties": [
    {
        "name": "hidden",
        "dataType": ["boolean"],
        "description": "Should the page be hidden",
    }
  ]    
},
    
   ... rest of props
]

No I try to query for :

self._client.query.get(class_name, ["text", "summary", "persistent_data { hidden }", "questions"]).with_where(
  {
             "path": ["persistent_data", "hidden"],
             "operator": "Equal",
              "valueBoolean": False
   }
)

I get following error:

[{'locations': [{'column': 6, 'line': 1}], 'message': "could not extract filters: invalid where filter: missing an argument after 'hidden'", 'path': ['Get', 'Page3']}]

I suppose the path is not defined correctly. Any idea what do I miss?

Hi!

Nested objects was released in 1.22, and it doesn’t support filtering yet.

We were not mentioning this in our docs :grimacing:

It should be updated soon to point that limitation.

Thanks for asking!!

1 Like

Thanks a lot for the reply.
Bad news but good to know, so we’ll have to use some workaround for now. Do you by any chance have an idea ‘how soon’ this filtering might bo coming?

It is in our backlog and listed as an issue here

It’s a good one to leave a thumbs up there so we can try to influentiate that roadmap :wink:

Hi,
Is filtering now available in nested objects? Trying to query nested objects using where filter but getting error in addressing path. When will this feature be made available?

You can check the backlog / roadmap linked above. It’s in backlog there with 20 votes, so my guess is it’s still not available but I’m not associated with Weaviate team so that’s all I know.

1 Like