[Zope-dev] Hey Chris, question for you
Casey Duncan
cduncan@kaivo.com
Tue, 26 Jun 2001 11:39:34 -0600
Chris:
I am working on getting a decent query language for ZCatalog/Catalog and
I have been able to make good progress, however I am running into a bit
of an issue that I thought you might know something about:
In order to implement a "!=" query operator, I am trying to do the
following:
>From the index, return the result set that match the value (easy)
Subtract that from the set of all items in the index (not so easy)
I see that there is the difference method available from IIBTree,
however I seem to be unable to use it on the entire index (Which is an
OOBTree and not really a set I guess). Here is a snippit of my code
which doesn't work:
if op == '!=' or op[:3] == 'not':
w, rs = difference(index._index, rs) # XXX Not a warm fuzzy...
(where rs is the index result set that matches the value and index is
the Catalog index OOBTree)
What can I supply for the first argument to get a set of all items in
the index, or is there any easier and better approach to this whole
issue?
BTW: I realize I could step though _index.items() and create an IISet
but that seems awful inefficient...
Thanks in advance for any ideas you might have...
--
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>