[Zope] Combining hits from searching 2 ZCatalogs at once
Chris Withers
chrisw@nipltd.com
Fri, 02 May 2003 17:01:42 +0100
Hi Casey,
Casey Duncan wrote:
>
> Here is a simple example (external method):
>
> from Products.ZCatalog.Catalog import mergeResults
>
> def queryMultipleCatalogs(request, *zcatalogs):
> results = []
> for zcat in zcatalogs:
> results.append(zcat1._catalog.searchResults(request, _merge=0))
> sorted = request.has_key('sort-on') or request.has_key('sort_on')
> reverse = ((request.get('sort-order','') or
> request.get('sort_order','')).lower()
> in ('reverse','descending'))
> return mergeResults(results, sorted, reverse)
Could something similar be used to solve this problem?
http://mail.zope.org/pipermail/zope-dev/2003-April/019456.html
http://mail.zope.org/pipermail/zope-dev/2003-May/019485.html
cheers,
Chris