The zope.index package provides several indices for the Zope catalog. These include:
Remove zope.testing from dependencies, as it's not really needed.
Define IIndexSort interface for indexes that support sorting.
Implement sorting for FieldIndex (adapted from repoze.catalog/ZCatalog).
Add an apply method for KeywordIndex/TopicIndex, making them implement IIndexSearch that can be useful in catalog.
Optimize the search method of KeywordIndex/TopicIndex by using multiunion for the or operator and sorting before intersection for and.
IMPORTANT: KeywordIndex/TopicIndex now use IFSets instead of IISets. This makes it more compatible with other indexes (for example, when using in catalog). This change can lead to problems, if your code somehow depends on the II nature of sets, as it was before.
Also, FilteredSets used to use IFSets as well, if you have any FilteredSets pickled in the database, you need to migrate them to IFSets yourself. You can do it like that:
filter._ids = filter.family.IF.Set(filter._ids)
Where filter is an instance of FilteredSet.
IMPORTANT: KeywordIndex are now non-normalizing. Because it can be useful for non-string keywords, where case-normalizing doesn't make any sense. Instead, it provides the normalize method that can be overriden by subclasses to provide some normalization.
The CaseInsensitiveKeywordIndex class is now provided that do case-normalization for string-based keywords. The old CaseSensitiveKeywordIndex is gone, applications should use KeywordIndex for that.
Looks like the KeywordIndex/TopicIndex was sort of abadonware and wasn't used by application developers, so after some discussion we decided to refactor them to make them more usable, optimal and compatible with other indexes and catalog.
Porting application from old KeywordIndex/TopicIndex to new ones are rather easy and explained above, so we believe that it isn't a problem. Please, use zope3-users@zope.org or zope-dev@zope.org mailing lists, if you have any problems with migration.
Thanks Chris McDonough of repoze for supporting and useful code.
No further changes since 3.4.0a1.
Initial release as a separate project, corresponds to zope.index from Zope 3.4.0a1