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 _______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )