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
Luton, Alex wrote:
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:
hi, you have to remove duplicates from a sequence. here are some nice howtos: http://www.python.org/cgi-bin/faqw.py?req=show&file=faq04.064.htp http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560 cheers, maik
participants (2)
-
Luton, Alex -
Maik Jablonski