Why does deep filtering by URL no longer work?

Hello,
on the Beta Version of Strapi there is no problem with deep filtering. The following is working without problems: /restaurants?address.city=New York.

But in the stable release I can’t use deep filtering anymore. Here is an example project.
For example try to open http://localhost:1337/cities?location.id=1. It throughs the following error: Your filters contain a field 'location.id' that doesn't appear on your model definition nor it's relations.

Does anyone know why this feature isn’t working in newer versions of strapi and how to fix it?

Thanks.

System Information
  • Strapi Version: 3.2.5
  • Operating System: macOS
  • Database: MySQL
  • Node Version: 12.18.3
  • NPM Version: 6.14.6

Deep filtering is only for fields defined in the model settings file, in the case of ID you can just use: http://localhost:1337/cities?location=1

Hey Derrick,

thank you. I chose id arbitrarily to to demonstrate the issue. It’s also not working with any other constellation.
I extended the example by adding an component. If you try to call http://localhost:1337/cities?spots.freeText=available it’s still not working.

Regards
Marius

We don’t currently and have never supported deep filtering on components.

See:

For the moment if you need filtering, it’s best to use a relationship.

2 Likes

Providing a minor update to this, that in our upcoming v4 we will support filtering on components but not on dynamic zones (polymorphic relations are a massive pain to that level of filtering, we will probably never it add it to dyn zones or the upload plugin)

1 Like