Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
FieldIndex
✓ from zope.index.field import FieldIndex
✗ from zope.index import FieldIndex
FieldIndex is in the field submodule, not top-level.
TextIndex
✓ from zope.index.text import TextIndex
✗ from zope.index import TextIndex
TextIndex is in the text submodule.
SetIndex
✓ from zope.index.set import SetIndex
✗ from zope.index import SetIndex
SetIndex is in the set submodule.
Create a FieldIndex, index two objects, search for one.
from zope.index.field import FieldIndex
index = FieldIndex()
index.index_object(1, 'value1')
index.index_object(2, 'value2')
hits = index.search({'any_of': ('value1',)})
print(hits)
# Result: {1: 1}
Errors
Common errors & fixes
AttributeError: module 'zope.index' has no attribute 'FieldIndex'
Importing from top-level instead of submodule.
fixUse 'from zope.index.field import FieldIndex'
zope.interface.interface.InvalidInterface: '...' is not a valid interface
Incorrect interface passed to index constructor (e.g., fieldname wrong).
fixCheck that the interface attribute exists and matches the name expected by the index.
Upgrade
Version history
8.1latest on PyPI · released Nov 18, 2025
Audit
Dependencies
zope.interfacerequiredCore dependency for interface declarations.