[Zope] Intersection/Union of ZCatalog result sets

Jonathan Hobbs toolkit at magma.ca
Thu Sep 23 16:26:28 EDT 2004


From: "Andreas Jung" <lists at andreas-jung.com>
> You should have a look at AdvancedQuery for perform complex ZCatalog
> queries.
>
> -aj
>
> --On Mittwoch, 22. September 2004 17:31 Uhr -0400 Jonathan Hobbs
> <toolkit at magma.ca> wrote:
>
> > I have found some old references to proposals for implementing the
ability
> > to combine (intersection, union) the result sets from multiple ZCatalog
> > queries.  Does anyone know if the ability to combine two or more 'lazy
> > result sets' has been implemented?
> >
> > Hunting through the zope source code the only similar routines I could
> > find were in the BTrees and ZCTextIndex code, but they deal with
> > intersection/union of BTrees (not lazy result sequences).  As an
> > alternative, is there any way to get ZCatalog search results in 'BTree'
> > form instead of lazy results?

Thanks for the lead Andreas.

I had a look at Dieter's AdvancedQuery routines and while they offer
improved functionality for searching within a zcatalog they do not support
joins/intersections of results from different catalog searches

eg. I am trying to achieve:

result = CatalogA.searchResults({some query}) &&
CatalogB.searchResults({some other query})

I think I am going to have to develop another type of catalog search which
returns non-lazy sequences and then do the join/intersections myself (sigh).

Thanks again,

Jonathan




More information about the Zope mailing list