Skip to content

Keep OGM harvests synchronized with search - #18

Merged
ewlarson merged 1 commit into
developfrom
feature/ogm-harvest-search-sync
Oct 2, 2026
Merged

ewlarson merged 1 commit into
developfrom
feature/ogm-harvest-search-sync

Conversation

@ewlarson

@ewlarson ewlarson commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Problem and fix

OGM harvests updated PostgreSQL but never refreshed Elasticsearch. Production held 321,304 published resources while unfiltered search returned only 136,942 indexed records.

Synchronize each harvested repository into the live index before reporting success. The helper uses keyset pagination, bulk writes, and prefetched enrichments in an isolated process; it refreshes search and suggestion caches afterward. Unpublished database records are removed from search, and indexing failures make the harvest visibly fail. The live index and PostgreSQL data are preserved.

Prepare v0.10.1 and document manual reconciliation and the distinction between repository memberships and unique records. Search also includes published records without repository tags.

Validation

  • 12 focused tests passed, including pagination, unpublished-record removal, cache invalidation, partial-index failure, harvest failure propagation, and dashboard/API rendering.
  • Ruff and whitespace checks passed.
  • A separate production repair index indexed all 321,304 published records with zero errors and an exact database count match. Live search is being reconciled from that validated index.

@ewlarson
ewlarson merged commit fb2cfcd into develop Oct 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant