Collection employing a boolean OR instead of AND

I have a user (who is quite intelligent, but unversed in computer science) who created a collection with two criteria. The default collection in Plone uses a Boolean AND between criteria, and she assumed that there would be a Boolean OR. Is there some switch that we could create to enable a collection to use (all) Boolean "OR" rather than "AND"? I suspect that a mix of and's and or's would be cumbersome, but having a switch at the beginning of the collection interface (with the default as "and") would do the trick. Something like:

Return all objects that:
* match ALL of the following criteria (default)
* match ANY of the following criteria

... using a radio button for the selection.

There is no OR - neither on the internal ZCatalog level nor on the collection side. Only a query against a single keyword index can be either AND or OR. But it is not possible to express an OR with two distinct criteria aka indexes.

This was somehow possible with the old AdvancedQuery plugin for Zope (not sure if it is still maintained and working with Plone)....at least it has no integration with Plone collections.

-aj

The interface of Plone's search engine (the ZCatalog) is targeted at simplified search forms. It has support for "in field" "OR" but the partial result of different fields are always combined by "AND". When I remember right, the Zope Book documents quite well, what you can do with ZCatalog.

A long time ago, I have developed Products.AdvancedQuery (--> PyPI). It supports arbitrary "AND", "OR", "NOT" combinations. However, it may not work with all Plone indexes: some special indexes make active use of ZCatalog internals and Products.AdvancedQuery is not ZCatalog. Nevertheless, it might come in handy in some cases where you need more control over search operators.

Not sure if it does what you ask for, and maybe a bit overkill, but you could look at: https://github.com/eea/eea.facetednavigation

Facted navigation is always based on AND...so why do you recommend this here?

Because (as you probably understand) I thought that it supported it… I have not used it for some years, and the UI showed me this:

4536

Between elements but not between subqueries...you should know how the catalog works.
Your anwser is wrong.

Unfortunately, not everybody can be as smart and friendly as you

Check the years of your Plone experience as integrator against the number of improper and unrelated answers

-aj

Espen, I find most of your contributions very helpful - especially, those related to frontend questions. Do not worry too much about occasional errors -- nobody is perfect and everybody has the right to err occasionally.