[Zope-dev] Sorting for zope.app.catalog

Chris McDonough chrism at plope.com
Tue Dec 30 17:38:53 EST 2008


Dan Korostelev wrote:
> 
> If _sort_index is not specified, catalog just uses list mechanisms to
> limit/reverse results. I don't think that makes any sense though.
> If _sort_index is specified, all sorting, reversing and limiting
> functionality is done by the ``sort`` method of specified index. That
> index should provide the new IIndexSort interface, defined by
> zope.index.
> 
Hi Dan,

Note that there's a slight optimization that could be added to z.a.catalog that
could help in a very limited case.  If the _sort_index is also a search index in
the query, if you run an intersection against that index last (e.g. via
"weightedIntersection"), the results will already be sorted by value and the
sort method of the index needn't be run.  At least I think this is true.

- C



More information about the Zope-Dev mailing list