Hi, I have a bunch of objects (CMF content but I don't think that's relevant to the question) which are conceptually closely related - they are different versions of the same content. I want to be able to ensure that a search returns at most one of the related objects. I can't think of any way to do this with stock ZCatalog, and I've been looking at Dieter's AdvancedQuery but can't quite sort it out there either. The semantics I want are like this: given a FieldIndex F, an object o, and a query parameter foo, o is a match if o's value for F is foo or o's value for F is "default" AND there are no relatives of o whose value for F is foo I think I could implement this with a bunch of post-processing of the query results, but that seems likely to be slowwww. any ideas? -- Paul Winkler http://www.slinkp.com
I think you can't achive that without postprocessing. The indexes themselves only know about 'or' and 'and' but not about 'xor'. -aj --On Mittwoch, 30. Juni 2004 15:27 Uhr -0400 Paul Winkler <pw_lists@slinkp.com> wrote:
Hi,
I have a bunch of objects (CMF content but I don't think that's relevant to the question) which are conceptually closely related - they are different versions of the same content. I want to be able to ensure that a search returns at most one of the related objects. I can't think of any way to do this with stock ZCatalog, and I've been looking at Dieter's AdvancedQuery but can't quite sort it out there either. The semantics I want are like this:
given a FieldIndex F, an object o, and a query parameter foo, o is a match if o's value for F is foo or o's value for F is "default" AND there are no relatives of o whose value for F is foo
I think I could implement this with a bunch of post-processing of the query results, but that seems likely to be slowwww.
any ideas?
--
Paul Winkler http://www.slinkp.com _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
given a FieldIndex F, an object o, and a query parameter foo, o is a match if o's value for F is foo or o's value for F is "default" AND there are no relatives of o whose value for F is foo
I think I could implement this with a bunch of post-processing of the query results, but that seems likely to be slowwww.
You use "relatives" objects, that's a relational query... ZCatalog cannot do that. You'll have to post-process or, maybe better, pre-process. Or use SQL. Florent -- Florent Guillaume, Nuxeo (Paris, France) +33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com
participants (3)
-
Andreas Jung -
Florent Guillaume -
Paul Winkler