Skip to main content

PostgreSQL-backed catalog for Plone replacing ZCatalog BTrees indexes

Project description

plone.pgcatalog

PostgreSQL-backed catalog for Plone, replacing ZCatalog BTrees indexes with SQL queries on JSONB.

Requires zodb-pgjsonb as the ZODB storage backend.

Features

  • All standard index types supported: FieldIndex, KeywordIndex, DateIndex, BooleanIndex, DateRangeIndex, UUIDIndex, ZCTextIndex, ExtendedPathIndex, GopipIndex
  • DateRecurringIndex for recurring events (Plone's start/end indexes) -- recurrence expansion at query time via rrule_plpgsql, no C extensions needed
  • Extensible via IPGIndexTranslator named utilities for custom index types
  • Dynamic index discovery from ZCatalog at startup -- addons adding indexes via catalog.xml just work
  • Transactional writes -- catalog data written atomically alongside object state during ZODB commit
  • Full-text search via PostgreSQL tsvector/tsquery
  • Zero ZODB cache pressure -- no BTree/Bucket objects stored in ZODB
  • Container-friendly -- works on standard postgres:17 Docker images, no extensions required

Requirements

  • Python 3.12+
  • PostgreSQL 14+ (tested with 17)
  • zodb-pgjsonb
  • Plone 6

Installation

pip install plone-pgcatalog

Add to your Zope configuration:

<!-- zope.conf -->
%import zodb_pgjsonb
<zodb_main>
  <pgjsonb>
    dsn dbname=mydb user=zodb password=zodb host=localhost port=5432
  </pgjsonb>
</zodb_main>

Install the plone.pgcatalog:default GenericSetup profile through Plone's Add-on installer or your policy package.

Usage

Once installed, portal_catalog is replaced with PlonePGCatalogTool. All catalog queries use the same ZCatalog API:

# Standard catalog queries -- same syntax as ZCatalog
results = catalog(portal_type="Document", review_state="published")
results = catalog(Subject={"query": ["Python", "Plone"], "operator": "or"})
results = catalog(SearchableText="my search term")
results = catalog(path={"query": "/plone/folder", "depth": 1})

# Recurring events (DateRecurringIndex)
results = catalog(start={
    "query": [DateTime("2025-03-01"), DateTime("2025-03-31")],
    "range": "min:max",
})

Documentation

License

GPL-2.0

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plone_pgcatalog-1.0.0b2.tar.gz (116.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plone_pgcatalog-1.0.0b2-py3-none-any.whl (53.6 kB view details)

Uploaded Python 3

File details

Details for the file plone_pgcatalog-1.0.0b2.tar.gz.

File metadata

  • Download URL: plone_pgcatalog-1.0.0b2.tar.gz
  • Upload date:
  • Size: 116.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plone_pgcatalog-1.0.0b2.tar.gz
Algorithm Hash digest
SHA256 f8c14d9bafc7ede3446cd6fbb8a8e34a556f365e406c98c22ea870ee86e37ab7
MD5 d8f4df9d571c15aa98f6b8345b611f13
BLAKE2b-256 819d58af59b694485d6d7a0a8034831098d7776bce50f6afc20cee2d29f8ac8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for plone_pgcatalog-1.0.0b2.tar.gz:

Publisher: release.yaml on bluedynamics/plone-pgcatalog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file plone_pgcatalog-1.0.0b2-py3-none-any.whl.

File metadata

File hashes

Hashes for plone_pgcatalog-1.0.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 b432bfb694ac4d39646d1ef54f4c9bddf8d851ed025b7013556b4864c0e48d9b
MD5 8279583b244dd99367ad12fc11011a13
BLAKE2b-256 5f13beccffc148632a4bc5f234b9c90b93036a1a410c845e73037ada3e501bb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for plone_pgcatalog-1.0.0b2-py3-none-any.whl:

Publisher: release.yaml on bluedynamics/plone-pgcatalog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page