{"id":24870,"library":"zope.index","title":"zope.index","description":"Provides index implementations (field, text, set, etc.) for use with cataloging systems. Version 8.1, requires Python 3.10+. Maintenance mode.","status":"maintenance","version":"8.1","language":"python","source_language":"en","source_url":"https://github.com/zopefoundation/zope.index","tags":["zope","catalog","index","maintenance","field","text"],"install":[{"cmd":"pip install zope.index","lang":"bash","label":"Latest release"}],"dependencies":[{"reason":"Core dependency for interface declarations.","package":"zope.interface","optional":false}],"imports":[{"note":"FieldIndex is in the field submodule, not top-level.","wrong":"from zope.index import FieldIndex","symbol":"FieldIndex","correct":"from zope.index.field import FieldIndex"},{"note":"TextIndex is in the text submodule.","wrong":"from zope.index import TextIndex","symbol":"TextIndex","correct":"from zope.index.text import TextIndex"},{"note":"SetIndex is in the set submodule.","wrong":"from zope.index import SetIndex","symbol":"SetIndex","correct":"from zope.index.set import SetIndex"}],"quickstart":{"code":"from zope.index.field import FieldIndex\nindex = FieldIndex()\nindex.index_object(1, 'value1')\nindex.index_object(2, 'value2')\nhits = index.search({'any_of': ('value1',)})\nprint(hits)\n# Result: {1: 1}","lang":"python","description":"Create a FieldIndex, index two objects, search for one."},"warnings":[{"fix":"Evaluate if you need full Zope catalog stack; many use cases can be replaced with plain dicts.","message":"zope.index is in maintenance mode. No new features likely. Consider alternatives if starting fresh.","severity":"deprecated","affected_versions":">=8.0"},{"fix":"Call index.updateIndex() after batch indexing operations to flush changes.","message":"After indexing, you must explicitly apply pending updates via index.updateIndex() for some index types (e.g., SetIndex) before search works.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from zope.index.field import FieldIndex'","cause":"Importing from top-level instead of submodule.","error":"AttributeError: module 'zope.index' has no attribute 'FieldIndex'"},{"fix":"Check that the interface attribute exists and matches the name expected by the index.","cause":"Incorrect interface passed to index constructor (e.g., fieldname wrong).","error":"zope.interface.interface.InvalidInterface: '...' is not a valid interface"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}