[Zope-dev] Sorting for zope.index
Dan Korostelev
nadako at gmail.com
Sun Dec 28 05:50:28 EST 2008
Hi, Chris and other developers.
I adapted repoze.catalog field index sorting code and tests for
standard zope.index FieldIndex and looks like it works. :)
Though I like raising the KeyError when trying to sort docids that are
not indexed, I had to remove it from interface declaration, and change
it to skipping values as in ZCatalog/repoze.catalog. The problem is
that it's not trivial to efficiently implement that checking in some
cases. For example in FieldIndex sort method, in the use_lazy branch,
set intersections are used and I can't see a way to check if some of
docids are not indexed besides storing some additional variable which
sucks. :)
I also adapted repoze.catalog's KeywordIndex fixes/optimizations to
zope.index KeywordIndex and TopicIndex.
There is now also a "nadako-sorting" branch of zope.app.catalog. It
adds sorting/limiting/reversing features to the "searchResults" method
of catalog. It also introduces KeywordIndex for catalog, because I
added support for IIndexSearch to zope.index KeywordIndex. :)
I request some review from developers and if there won't be any
objections, I'll merge this code to trunks of zope.index and
zope.app.catalog.
Thanks in advance.
--
WBR, Dan Korostelev
More information about the Zope-Dev
mailing list