Index types reference¶
This page documents the index types supported by plone.pgcatalog,
the mapping from ZCatalog meta types, special indexes stored outside
the idx JSONB column, and the index registry API.
IndexType enum¶
Defined in plone.pgcatalog.columns.
Each value represents a category
of index behavior that determines how queries are translated to SQL.
Enum Value |
Description |
|---|---|
|
Single-value equality and range queries. |
|
Multi-value membership queries (OR/AND). |
|
Timestamp queries with range support. |
|
True/False containment check. |
|
Effective/expiry date range (used by |
|
UUID equality. |
|
Full-text search (tsvector or BM25). |
|
Path hierarchy queries with depth support. |
|
Integer position ordering (getObjPositionInParent). |
META_TYPE_MAP¶
Maps ZCatalog meta_type strings to IndexType enum values.
Defined in plone.pgcatalog.columns.
ZCatalog meta_type |
IndexType |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Special indexes¶
These indexes are stored in dedicated columns on the object_state table
rather than inside the idx JSONB column.
They have idx_key=None in the
index registry.
Index Name |
Storage |
Notes |
|---|---|---|
|
|
Language-aware via |
|
|
Compound date range query across two JSONB keys. |
|
|
Dedicated columns for fast hierarchy queries. |
Index registry¶
The IndexRegistry is a singleton that maps index names to their type
information.
It is populated at startup by sync_from_catalog(), which
reads the indexes defined on the Plone ZCatalog instance.
Each registry entry is a 3-tuple:
(IndexType, idx_key, source_attrs)
IndexType: One of the enum values listed above.idx_key: The key used in theidxJSONB column, orNonefor special indexes.source_attrs: Tuple of source attribute names, as returned bygetIndexSourceNames()on the ZCatalog index object.
Unknown ZCatalog meta_type values not present in META_TYPE_MAP are
skipped during sync.
These are expected to be handled by
IPGIndexTranslator named utilities instead.
Access the registry:
from plone.pgcatalog.columns import get_registry
registry = get_registry()
Custom index types¶
Index types not listed in META_TYPE_MAP (such as DateRecurringIndex,
DateRangeInRangeIndex, or composite indexes) are supported via
IPGIndexTranslator named utilities.
Each translator provides query
generation and index data extraction for its index type.
See IPGIndexTranslator interface reference for the interface specification and implementation details.