Wanderland

Runbook: Rebuild the Solr data cores

How to rebuild the Solr search cores from the database. Companion to advaita-service-solr. Source: ADV-273 (Radu + Graeme investigation).

What this does

The search index (ars-dih) and autocomplete index (ars-suggester) are built from the ars PostgreSQL database by Solr's DataImportHandler (DIH). Rebuilding the cores runs the DIH full-import, which executes the configured SQL against ars and writes a fresh Lucene index to the core's data directory on EFS.

Cores and where they live

How the import is wired

DIH entity model (verified from the live v1906 cores, 2026-06-17)

Read from the legacy cores at /mnt/cores-src through the bastion. Engine is Solr 5 (luceneMatchVersion 5.0.0); each core registers <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> with config = solr-data-config.xml. solr.xml is SolrCloud-flavored (<solrcloud>, hostPort 8983), and the cores run by core discovery (a core.properties per core).

Data source (both cores). jdbc:postgresql://clouddev.c5ikqcjohlrx.us-west-2.rds.amazonaws.com:5432/ars?sslmode=require (prod: prod-cloud…), user ars, password hardcoded in solr-data-config.xml (redacted here — externalize on the git move). Queries read the ars.* schema and filter joined database rows to status = 'PRODUCTION'.

ars-dih (search). Five top-level entities, each emitting one Solr doc with id = '<type>:'||<dbid>, identifier, name, description, organism_info / organism_name, type, num_relationships, plus relationship scores from nested subqueries:

Each *_count subquery is count(DISTINCT …) / ${dataimporter.request.total} * 100.0 written to a <x>_relationship_score field (pathway/go_term/mirna/disease/drug/gene). These are the fields the edismax bf boost sums in solr-client / biob.

ars-suggester (autocomplete). Term entities producing term + the same relationship scores for type-ahead: gene_name, gene_symbol, go_name, go_symbol, pathway, disease, mirna (per dataimport.properties).

Last full import. ars-dih 2020-10-27, ars-suggester 2020-10-27 (dev v1906); a few suggester entities still carry 2015 stamps. Prod last rebuilt Feb 2022 (ADV-273).

Where the data lives. Read-only source: /mnt/cores-src (legacy s3cache cache/v1906/solr). The clone that solr-bddev:6 serves read-write is /mnt/efs/cores-test/solr on the shared EFS, mounted at /data/solr. A v19.4 build lands in a new cores tree on the shared EFS.

Prerequisites

Verified on the migrated tier (bddev, 2026-06-17). solr-bddev:6 runs core/solr:5.0.0-fargate. The cores mount solr-cores/data/solr is read-write (IAM access point fsap-07a8a2b756381f5ba on the shared EFS fs-072246d867e8a8c71 — the ADV-269 cores clone), so DIH can take the write.lock. The container carries no env; Solr config is baked into the image. DIH data source ars: dev RDS clouddev.c5ikqcjohlrx.us-west-2.rds.amazonaws.com:5432/ars (Postgres 15.17), prod prod-cloud.c5ikqcjohlrx.us-west-2.rds.amazonaws.com — matching the hardcoded JDBC url in solr-data-config.xml.

Rebuild an existing core

Create v19.4 cores

Current cores are v1906 (2019); prod was last rebuilt Feb 2022. To produce v19.4:

Back up the configs

The core configs exist only on EFS. Back them up and move them to a GitHub repository (planned in ADV-273) so they are version-controlled: solrconfig.xml, solr-data-config.xml, schema, configsets.

Cautions

Open / TBD