Skip to content

Feature: Add alias-based Solr rebuild and cutover workflow to cron scripts (ALT)#126

Draft
mdorf wants to merge 5 commits into
developfrom
feature/solrcloud-alias-indexing-claude
Draft

Feature: Add alias-based Solr rebuild and cutover workflow to cron scripts (ALT)#126
mdorf wants to merge 5 commits into
developfrom
feature/solrcloud-alias-indexing-claude

Conversation

@mdorf
Copy link
Copy Markdown
Member

@mdorf mdorf commented Apr 14, 2026

Summary

Reworks ncbo_ontology_index and ncbo_ontology_property_index to use the new SolrCloud alias re-index workflow, adds flexible alias promotion flags, and introduces an ncbo_search_aliases inspection script.

Prerequisites

This PR depends on changes introduced in:

Changes

bin/ncbo_ontology_index and bin/ncbo_ontology_property_index

Both scripts now support three workflows via new CLI flags:

Flags Behavior
-a -c NAME Rebuild all into a new collection (no alias swap)
-a -c NAME -p Rebuild all, then promote alias on success
--promote-only -c NAME Promote alias to an existing collection without rebuilding
  • -c is required with -a (full re-index must target an explicit collection name)
  • -o (individual ontologies) continues to index directly into the live alias, unchanged
  • Both scripts use Goo.promote_alias instead of Goo.complete_reindex, preserving the old collection for rollback

bin/ncbo_search_aliases (new)

Inspection script that reports the current state of term_search and prop_search aliases and their backing collections.

config/config.rb.sample

Removed obsolete search_index_all_url and property_search_index_all_url settings, replaced with a comment explaining the new -c flag usage.

Test plan

  • ncbo_ontology_index -h and ncbo_ontology_property_index -h display updated help with examples
  • ncbo_ontology_index -a -c term_search_test creates collection, indexes, does not swap alias
  • ncbo_ontology_index --promote-only -c term_search_test swaps alias without rebuilding
  • ncbo_ontology_index -a -c term_search_test -p creates, indexes, and swaps alias on success
  • ncbo_ontology_index -o SNOMEDCT indexes into live alias (existing behavior)
  • ncbo_search_aliases reports correct alias → collection mappings
  • Validate the same workflows for ncbo_ontology_property_index

mdorf added 5 commits April 13, 2026 12:07
Replaces the old -c URL flag with -c COLLECTION_NAME. Full re-index
(-a) now creates a new collection, indexes into it, then atomically
swaps the alias and deletes the old collection. Individual ontology
indexing (-o) goes through the live alias unchanged.

Removes the Goo.configure/add_search_backend hack, valid_url? check,
and search_index_all_url references. The -c flag is now required
with -a to enforce explicit collection naming.

Usage:
  ./bin/ncbo_ontology_index -a -c term_search_20260413
  ./bin/ncbo_ontology_property_index -a -c prop_search_20260413
  ./bin/ncbo_ontology_index -o SNOMEDCT,GO
These settings are no longer used — full re-indexing now uses
SolrCloud aliases with explicit collection names passed via the
-c flag on the index scripts.
Index scripts now support three workflows:
  -a -c NAME        rebuild without alias swap (existing)
  -a -c NAME -p     rebuild then promote alias on success
  --promote-only -c promote alias to existing collection, no rebuild

New ncbo_search_aliases script inspects active aliases and their
backing collections for term_search and prop_search.
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