[Zope-CMF] Building a query using NOT

Tres Seaver tseaver@digicool.com
Fri, 18 May 2001 07:02:47 -0400


Ben Riga wrote:
> 
> I'm having some trouble building a query for a method I'm working on.  Any
> help, suggestions or pointers to reference or further reading material would
> be appreciated.
> 
> I'm trying to build a query on the catalog that includes items that are
> *not* in a particular 'Subject'.   In this case I'd like to get the
> documents in the catalog that would NOT be in the following query:
> 
> <dtml-in "portal_catalog.searchResults(
>     Subject = ['Analysts', 'Press']
>   , sort_order='reverse' , review_state='published')" size="10">

Can't be done in DTML;  the catalog's indexes don't provide for
such queries.  You *could* implement it in Python, by doing the
equivalent of a "table scan" query in SQL (i.e., won't scale well
at all).

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@digicool.com
Digital Creations     "Zope Dealers"       http://www.zope.org