[Zope] joining zcatalog search results

Meilicke, Scott scott.meilicke@intp.com
Tue, 12 Nov 2002 08:00:15 -0800


Could you then stuff your results into a dictionary, using as the key
something unique, perhaps path or absolute url?  As the dictionary is
stuffed with duplicates, they will just get over written.  

Scott

-----Original Message-----
From: Luton, Alex [mailto:ALuton@rcseng.ac.uk]
Sent: Tuesday, November 12, 2002 5:23 AM
To: zope@zope.org
Subject: [Zope] joining zcatalog search results


Hi,

I have a fairly simple query about processing zcatalog search results. I
want to search a zcatalog of dtml pages based on their text content and
title. At the moment, I'm doing  two separate searches and concatenating
the results using a script, much the same as the example in the zope
book. When the two results are concatenated duplicates may occur, so I'm
looking for a way to join the two correctly. This must be a fairly
common requirement, but I can't find any similar examples. Here's my
python script:

Parameters : query

titles = context.catalog({'title' : query})
princes = context.catalog({'PrincipiaSearchSource' : query})

return titles + princes

--
Alex
This e-mail and any attached files are confidential and are intended
solely for the use of the individual or entity to whom they are
addressed.

This communication represents the originators personal views and
opinions, which do not necessarily reflect those of The Royal College of
Surgeons of England.

If you are not the intended recipient, or the person responsible for
delivering the e-mail to the intended recipient, be advised that you
have received this e-mail in error, and that any use, dissemination,
forwarding, printing or copying of this e-mail is strictly prohibited.

http://www.rcseng.ac.uk

Registered Charity Number: 212808

_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )
The information contained in this email message may be privileged and is
confidential information intended only for the use of the recipient or any
employee or agent responsible for delivering it to the intended recipient.
Any unauthorized use, distribution or copying of this information is
strictly prohibited and may be unlawful.  If you have received this
communication in error, please notify the sender immediately and destroy the
original message and all attachments from your electronic files.