Hi, I'm using Zope-2.6.1 with ZCatalog and several Keyword indexes. How can I make a query on a KeywordIndex to get objects for which a given value is not found ?? Typically, each of my objects is identified by a globally unique ID (OID) ; an object can keep a reference to another object through an "oid_refs" property (a list), which is indexed in a keyword index. What I want is to be able to find, for example, objects of a given meta-type, eventually stored in a given folder, which are NOT referenced by other objects. Thanks for any help, Thierry -- Linux every day, keeps Dr Watson away... http://gpc.sourceforge.net -- http://www.ulthar.net
(please don't post in HTML!) FLORAC Thierry wrote:
I'm using Zope-2.6.1 with ZCatalog and several Keyword indexes. How can I make a query on a KeywordIndex to get objects for which a given value is not found ??
Not easily :-/ The underlying BTrees support this but ZCatalog's engine for combing them is pretty rigid. I think Casey did some work on breaking this apart recently, maybe he can help? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On Thu, 01 Apr 2004 17:46:05 +0100 Chris Withers <lists@simplistix.co.uk> wrote:
(please don't post in HTML!)
FLORAC Thierry wrote:
I'm using Zope-2.6.1 with ZCatalog and several Keyword indexes. How can I make a query on a KeywordIndex to get objects for which a given value is not found ??
Not easily :-/
The underlying BTrees support this but ZCatalog's engine for combing them is pretty rigid. I think Casey did some work on breaking this apart recently, maybe he can help?
Here is a recipe I wrote for this a while back: http://www.zopelabs.com/cookbook/1015785843/1026625784 hth, -Casey
Casey Duncan wrote:
Here is a recipe I wrote for this a while back:
Oh, maybe it wasn't you then :-S Someone refactored searchResults to it looks like it's guts can be used to do more sensible things, who was that? (and where did they document it?) Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On Thu, 01 Apr 2004 21:46:28 +0100 Chris Withers <lists@simplistix.co.uk> wrote:
Casey Duncan wrote:
Here is a recipe I wrote for this a while back:
Oh, maybe it wasn't you then :-S
This capability does not exist in the current catalog code or indexes which is why I wrote the ext. method.
Someone refactored searchResults to it looks like it's guts can be used to do more sensible things, who was that?
Jeremy did to modularize things and then I did thereafter to optimize sorting and clean up some remaining cruft.
(and where did they document it?)
What was changed wasn't public API and functionality was not changed other than adding the sort_limit capability which is documented in the hurt^H^H^Help system and interfaces. -Casey
Casey Duncan wrote:
Jeremy did to modularize things and then I did thereafter to optimize sorting and clean up some remaining cruft.
Aha, so, only partially guilty then ;-)
(and where did they document it?)
What was changed wasn't public API and functionality was not changed other than adding the sort_limit capability which is documented in the hurt^H^H^Help system and interfaces.
As you rightly point out, the "help" system is "dodgy" to say the least. What benefit sdoes setting sort_limit currently add? From what I saw, with the addition of a few security declarations, what refactoring meant that a normal Python Script could do funky stuff to generate more useful search results. Was I hallucinating? Chris PS: I'm still after the holy grail of being able to do boolean combination of indexed searches and sort on multiple indexes in a cascasding fashion. How'd you recommend tackling that now? PPS: Does Pypes make my holy grail possible? -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On Fri, 02 Apr 2004 09:15:47 +0100 Chris Withers <lists@simplistix.co.uk> wrote:
Casey Duncan wrote:
Jeremy did to modularize things and then I did thereafter to optimize sorting and clean up some remaining cruft.
Aha, so, only partially guilty then ;-)
(and where did they document it?)
What was changed wasn't public API and functionality was not changed other than adding the sort_limit capability which is documented in the hurt^H^H^Help system and interfaces.
As you rightly point out, the "help" system is "dodgy" to say the least. What benefit sdoes setting sort_limit currently add?
RTFM ;^) See: http://www.zope.org/Members/Caseman/ZCatalog_for_2.6.1
From what I saw, with the addition of a few security declarations, what refactoring meant that a normal Python Script could do funky stuff to generate more useful search results.
Was I hallucinating?
See search() method at bottom of: http://cvs.zope.org/Zope/lib/python/Products/ZCatalog/IZCatalog.py?rev=1.7&c... All this does though is remove dwim. It doesn't add new query capabilities.
PS: I'm still after the holy grail of being able to do boolean combination of indexed searches and sort on multiple indexes in a cascasding fashion. How'd you recommend tackling that now?
My CatalogQuery product (assuming it still works with 2.7)
PPS: Does Pypes make my holy grail possible?
It will. -Casey
Casey Duncan wrote:
As you rightly point out, the "help" system is "dodgy" to say the least. What benefit sdoes setting sort_limit currently add?
RTFM ;^)
It would be nice if, just occassionally, TFM was in one f'ing place ;-)
See search() method at bottom of:
http://cvs.zope.org/Zope/lib/python/Products/ZCatalog/IZCatalog.py?rev=1.7&c...
All this does though is remove dwim. It doesn't add new query capabilities.
Indeed, but what I meant was "couldn't the things 'search' calls be exposed such that they could be used to to complex searches, including my holy grail?"
PS: I'm still after the holy grail of being able to do boolean combination of indexed searches and sort on multiple indexes in a cascasding fashion. How'd you recommend tackling that now?
My CatalogQuery product (assuming it still works with 2.7)
Hmmm, is that supported? Does it do sort on multiple columns?
PPS: Does Pypes make my holy grail possible?
It will.
Yay. Although, is there any reason why my holy grail shouldn't be possible using the ZCatalog data structures? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On Mon, 05 Apr 2004 11:00:21 +0100 Chris Withers <lists@simplistix.co.uk> wrote:
Casey Duncan wrote:
As you rightly point out, the "help" system is "dodgy" to say the least. What benefit sdoes setting sort_limit currently add?
RTFM ;^)
It would be nice if, just occassionally, TFM was in one f'ing place ;-)
Hey, the link was to zope.org...
See search() method at bottom of:
http://cvs.zope.org/Zope/lib/python/Products/ZCatalog/IZCatalog.py?rev=1.7&c...
All this does though is remove dwim. It doesn't add new query capabilities.
Indeed, but what I meant was "couldn't the things 'search' calls be exposed such that they could be used to to complex searches, including my holy grail?"
Yes, and what I was saying was that no such interface to ZCatalog exists.
PS: I'm still after the holy grail of being able to do boolean combination of indexed searches and sort on multiple indexes in a cascasding fashion. How'd you recommend tackling that now?
My CatalogQuery product (assuming it still works with 2.7)
Hmmm, is that supported? Does it do sort on multiple columns?
Support is relative. It doesn't sort multi-column.
PPS: Does Pypes make my holy grail possible?
It will.
Yay. Although, is there any reason why my holy grail shouldn't be possible using the ZCatalog data structures?
Depends on what you're holy grail is. pypes will support any ad-hoc query. The ZCatalog index API is too limited for that. It is possible to do multi-column sorting with the current ZCatalog data structures. Maybe I'll throw you a bone and implement it, but don't hold your breath ;^). OTOH, you can do it now by creating an index on multiple attributes. -Casey
participants (3)
-
Casey Duncan -
Chris Withers -
FLORAC Thierry