Negative catalog searches

It's not the first time that I found myself wanting to do searches like "give me all object that do NOT have this interface", or "give me all objects that are NOT that content type".

So is there a way to do that with plain portal_catalog or one needs external solutions like Solr (which we want to move but do not have right now)?

ZCatalog 3.0a1 added support for not queries in field and keyword indexes, see the changelog at

1 Like

Oh cool, thanks a lot for the pointer @vincentfretin!

You could use "Products.AdvancedQuery".

1 Like


So far, my needs only go are about searching for content types or marker interfaces not regular text, for that given the size of our database we will move to Solr so searches will be offloaded there.

By the way, you did quite a few packages to improve/extend ZCatalog, did you ever considered making a PLIP for them and integrating them into Zope/Plone? Now that we take control over the whole stack is the best time to integrate fixes, specially if they are about performance.

1 Like

and Plone 5.0 uses Products.ZCatalog = 3.0.2.

So we are missing collection support for negative queries...

1 Like

Not really. In modern (PyPI) times, you can easily integrate them in your installation ("eggs += ...") when you like them. Efforts to integrate them with Zope or Plone would reduce my independence without equivalent advantages.