[Zope-dev] Sorting for zope.index

Chris McDonough chrism at plope.com
Sat Dec 27 12:18:44 EST 2008


Dan Korostelev wrote:
> Hello, fellow zope developers :)
> 
> I made a "nadako-sorting" branch of zope.index to add sorting support
> for zope indexes. I defined a new IIndexSort interface that specifies
> a "sort" method that takes document ids and returns an iterable of
> those ids, sorted by indexed value. It supports optional "limit" and
> "reverse" arguments. It also raises KeyError if you pass a docid that
> is not indexed by this index.
> 
> Can someone review the interface definition and make any suggestions/objections?
> 
> I also made an implementation for the FieldIndex that may not be too
> optimal, but I'm currently most interested in clean and universal
> IIndexSort definition that any index could efficiently implement.
> 
> If there's no objections, I'd like to merge it to trunk and start
> adding sorting features for zope.app.catalog/z3c.indexer, as well as
> zc.catalog indexes.
> 
> Thanks in advance!
> 

Hi Dan,

I've done this work too... but outside zope.index... please see (for example):

http://svn.repoze.org/repoze.catalog/trunk/repoze/catalog/indexes/field.py

It's reasonably optimized.

- C


More information about the Zope-Dev mailing list