{"id":44807008,"url":"https://github.com/bluedynamics/plone-pgcatalog","last_synced_at":"2026-04-20T09:03:16.155Z","repository":{"id":337337699,"uuid":"1153149877","full_name":"bluedynamics/plone-pgcatalog","owner":"bluedynamics","description":"PostgreSQL-backed catalog for Plone, replacing ZCatalog BTrees indexes with SQL queries on JSONB.","archived":false,"fork":false,"pushed_at":"2026-03-11T01:38:21.000Z","size":23392,"stargazers_count":7,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-11T07:41:38.383Z","etag":null,"topics":["addon","catalog","plone","postgresql","zodb"],"latest_commit_sha":null,"homepage":"https://bluedynamics.github.io/plone-pgcatalog/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bluedynamics.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-09T00:42:25.000Z","updated_at":"2026-03-11T01:36:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bluedynamics/plone-pgcatalog","commit_stats":null,"previous_names":["bluedynamics/plone-pgcatalog"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/bluedynamics/plone-pgcatalog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluedynamics%2Fplone-pgcatalog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluedynamics%2Fplone-pgcatalog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluedynamics%2Fplone-pgcatalog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluedynamics%2Fplone-pgcatalog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bluedynamics","download_url":"https://codeload.github.com/bluedynamics/plone-pgcatalog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluedynamics%2Fplone-pgcatalog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30550569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-15T15:03:43.933Z","status":"ssl_error","status_checked_at":"2026-03-15T15:03:37.630Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addon","catalog","plone","postgresql","zodb"],"created_at":"2026-02-16T15:07:12.558Z","updated_at":"2026-04-02T22:35:32.502Z","avatar_url":"https://github.com/bluedynamics.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# plone.pgcatalog\n\nPostgreSQL-backed catalog for Plone, replacing ZCatalog BTrees indexes with SQL queries on JSONB.\n\nRequires [zodb-pgjsonb](https://github.com/bluedynamics/zodb-pgjsonb) as the ZODB storage backend.\n\n## Features\n\n- **All standard index types** supported: FieldIndex, KeywordIndex, DateIndex, BooleanIndex, DateRangeIndex, UUIDIndex, ZCTextIndex, ExtendedPathIndex, GopipIndex\n- **DateRecurringIndex** for recurring events (Plone's `start`/`end` indexes) -- recurrence expansion at query time via [rrule_plpgsql](https://github.com/sirrodgepodge/rrule_plpgsql), no C extensions needed\n- **Extensible** via `IPGIndexTranslator` named utilities for custom index types\n- **Dynamic index discovery** from ZCatalog at startup -- addons adding indexes via `catalog.xml` just work\n- **Transactional writes** -- catalog data written atomically alongside object state during ZODB commit\n- **Full-text search** via PostgreSQL `tsvector`/`tsquery` -- language-aware stemming for SearchableText (30 languages), word-level matching for Title/Description/addon ZCTextIndex fields\n- **Optional BM25 ranking** -- when `vchord_bm25` + `pg_tokenizer` extensions are detected, search results are automatically ranked using BM25 (IDF, term saturation, length normalization) instead of `ts_rank_cd`. Title matches are boosted. Falls back to tsvector ranking on vanilla PostgreSQL.\n- **Zero ZODB cache pressure** -- no BTree/Bucket objects stored in ZODB\n- **Container-friendly** -- works on standard `postgres:17` Docker images; for BM25 use `tensorchord/vchord-suite:pg17-latest`\n\n## Requirements\n\n- Python 3.12+\n- PostgreSQL 15+ (tested with 17)\n- [zodb-pgjsonb](https://github.com/bluedynamics/zodb-pgjsonb)\n- Plone 6\n\n## Installation\n\n```bash\npip install plone-pgcatalog\n```\n\nAdd to your Zope configuration:\n\n```xml\n\u003c!-- zope.conf --\u003e\n%import zodb_pgjsonb\n\u003czodb_main\u003e\n  \u003cpgjsonb\u003e\n    dsn dbname=mydb user=zodb password=zodb host=localhost port=5432\n  \u003c/pgjsonb\u003e\n\u003c/zodb_main\u003e\n```\n\nInstall the `plone.pgcatalog:default` GenericSetup profile through Plone's Add-on installer or your policy package.\n\n## Usage\n\nOnce installed, `portal_catalog` is replaced with `PlonePGCatalogTool`. All catalog queries use the same ZCatalog API:\n\n```python\n# Standard catalog queries -- same syntax as ZCatalog\nresults = catalog(portal_type=\"Document\", review_state=\"published\")\nresults = catalog(Subject={\"query\": [\"Python\", \"Plone\"], \"operator\": \"or\"})\nresults = catalog(SearchableText=\"my search term\")\nresults = catalog(SearchableText=\"Katzen\", Language=\"de\")  # language-aware stemming\nresults = catalog(Title=\"quick fox\")  # word-level match (finds \"The Quick Brown Fox\")\nresults = catalog(path={\"query\": \"/plone/folder\", \"depth\": 1})\n\n# Recurring events (DateRecurringIndex)\nresults = catalog(start={\n    \"query\": [DateTime(\"2025-03-01\"), DateTime(\"2025-03-31\")],\n    \"range\": \"min:max\",\n})\n```\n\n## Migrating an Existing Site\n\nIf you have a running Plone site and want to switch from ZCatalog to plone.pgcatalog:\n\n**Prerequisites:** Your site must already be running on\n[zodb-pgjsonb](https://github.com/bluedynamics/zodb-pgjsonb).\nIf you're migrating from FileStorage or RelStorage, use [zodb-convert](https://pypi.org/project/zodb-convert/) first.\n\n**Steps:**\n\n1. Install plone-pgcatalog into your Python environment:\n\n   ```bash\n   pip install plone-pgcatalog\n   ```\n\n2. Restart Zope (plone.pgcatalog is auto-discovered via `z3c.autoinclude`).\n\n3. Install the `plone.pgcatalog:default` GenericSetup profile -- either through the Plone Add-on control panel or programmatically:\n\n   ```python\n   setup = portal.portal_setup\n   setup.runAllImportStepsFromProfile(\"profile-plone.pgcatalog:default\")\n   ```\n\n   This replaces `portal_catalog` with `PlonePGCatalogTool`, preserving any addon-provided index definitions.\n\n4. Rebuild the catalog to populate PostgreSQL with all existing content:\n\n   ```python\n   catalog = portal.portal_catalog\n   catalog.clearFindAndRebuild()\n   ```\n\n   For a site with ~1000 documents, this takes about 15 seconds.\n\nAn automated migration script is included in `example/scripts/migrate_to_pgcatalog.py`\nthat performs all steps and verifies the result.\n\n## Using with plone.distribution\n\nAn example distribution package is included in `example/pgcatalog-example-distribution/`.\nIt registers a **\"Plone Site (PG Catalog)\"** distribution that appears in the site creation UI\nand automatically applies the `plone.pgcatalog:default` profile.\n\nTo use plone.pgcatalog in your own distribution, add it to `profiles.json`:\n\n```json\n{\n  \"base\": [\n    \"plone.app.contenttypes:default\",\n    \"plonetheme.barceloneta:default\",\n    \"plone.pgcatalog:default\"\n  ]\n}\n```\n\n## Documentation\n\nRendered documentation: **https://bluedynamics.github.io/plone-pgcatalog/**\n\n- [Architecture](https://github.com/bluedynamics/plone-pgcatalog/blob/main/docs/sources/explanation/architecture.md) -- design, index registry, query translation\n- [BENCHMARKS.md](https://github.com/bluedynamics/plone-pgcatalog/blob/main/BENCHMARKS.md) -- performance comparison vs RelStorage+ZCatalog\n- [CHANGES.md](https://github.com/bluedynamics/plone-pgcatalog/blob/main/CHANGES.md) -- changelog\n- [example/](https://github.com/bluedynamics/plone-pgcatalog/tree/main/example) -- runnable example with multilingual content and an example distribution\n\n## Source Code and Contributions\n\nThe source code is managed in a Git repository, with its main branches hosted on GitHub.\nIssues can be reported there too.\n\nWe'd be happy to see many forks and pull requests to make this package even better.\nWe welcome AI-assisted contributions, but expect every contributor to fully understand and be able to explain the code they submit.\nPlease don't send bulk auto-generated pull requests.\n\nMaintainers are Jens Klein and the BlueDynamics Alliance developer team.\nWe appreciate any contribution and if a release on PyPI is needed, please just contact one of us.\nWe also offer commercial support if any training, coaching, integration or adaptations are needed.\n\n## License\n\nGPL-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluedynamics%2Fplone-pgcatalog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluedynamics%2Fplone-pgcatalog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluedynamics%2Fplone-pgcatalog/lists"}