Overview
There are two Solr cores. The navbar badge at the top right always shows which one this Metadata Manager is currently treating as active.
| Core | Name | Used for |
|---|---|---|
| DEV | blacklight-core-dev |
Development and testing — safe to write/reindex freely |
| PROD | blacklight-core-prod |
Live search at search.sdohplace.org — only admins can index here |
Both cores live on the same host: http://localhost:8983/solr
Current Configuration
| Active core (this app) |
PROD blacklight-core
|
| Controlled by | MODE in .env on the server |
Switch this Metadata Manager between dev and prod
The server runs gunicorn directly inside a Python virtualenv — there is no Docker on this host.
The active core is controlled by MODE in the .env file.
Switching takes about 5 seconds and requires SSH access.
To switch to dev core:
ssh ubuntu@<ec2-host> cd /opt/metadata-manager/prod # or wherever the repo lives nano .env # set MODE=dev, save and exit ./scripts/restart_flask.sh
To switch back to prod core:
nano .env # set MODE=prod, save and exit ./scripts/restart_flask.sh
Reload this page after the restart — the navbar badge updates immediately to show the active core.
To deploy updated code from git:
git pull source env/bin/activate # activate the virtualenv pip install -e . # only needed if dependencies changed ./scripts/restart_flask.sh
Switch the Discovery App to read from dev
The discovery frontend (sdohplace-data-discovery) reads from whichever Solr core
its NEXT_PUBLIC_SOLR_URL points to. Change this one variable to switch cores —
no Metadata Manager restart needed.
For a Netlify deployment — set in the Netlify site's Environment Variables panel, then trigger a redeploy:
| Target | NEXT_PUBLIC_SOLR_URL |
|---|---|
| DEV | https://solr.sdohplace.org/solr/blacklight-core-dev |
| PROD | https://solr.sdohplace.org/solr/blacklight-core-prod |
For local development — edit .env in the
discovery app repo and restart npm run dev:
# Point at dev core NEXT_PUBLIC_SOLR_URL=https://solr.sdohplace.org/solr/blacklight-core-dev # Point at prod core NEXT_PUBLIC_SOLR_URL=https://solr.sdohplace.org/solr/blacklight-core-prod
Index records to a core
Changing MODE only affects the active core label — it does not automatically
copy records between cores. Use the buttons below or the CLI to populate a core.
Per-record (UI) — on each record's view page, the sidebar has:
- Index — Dev (blue): always available to logged-in users, writes to
blacklight-core-dev - Index — Prod (yellow): admin only, writes to
blacklight-core-prod
All records at once (CLI) — SSH into the server and run:
# Full refresh of dev core flask registry index --clean --env dev # Full refresh of prod core (admin action) flask registry index --clean --env prod
The --clean flag deletes all existing documents in the core before re-indexing.
Omit it to only add/update without removing stale records.