Solr and Elasticsearch - Legacy Search Engines
Deprecated
PostgreSQL with pgvector and pg_trgm is now the recommended search solution for OpenRegister. Solr and Elasticsearch are kept as optional profiles for backwards compatibility and migration purposes.
Why PostgreSQL is Now Recommended
| Feature | PostgreSQL (pgvector + pg_trgm) | Solr / Elasticsearch |
|---|---|---|
| Setup Complexity | ✅ Single container | ❌ Multiple services |
| Resource Usage | ✅ Minimal (~600MB) | ❌ High (~2-3GB) |
| Vector Search | ✅ Native (pgvector) | ⚠️ Requires plugins |
| Full-Text Search | ✅ Built-in (pg_trgm) | ✅ Native |
| Data Consistency | ✅ ACID transactions | ⚠️ Eventually consistent |
| Maintenance | ✅ Automatic with DB | ❌ Separate maintenance |
| Integration | ✅ Direct SQL | ❌ HTTP API + sync |
See the PostgreSQL Search Guide for the recommended approach.
When to Use Legacy Search Engines
You should only use Solr or Elasticsearch if you:
- Have existing Solr/Elasticsearch setup - Already invested in configuration
- Need specific features - Advanced analyzers, faceting, highlighting
- Require horizontal scaling - Multi-node search clusters
- Are migrating - Temporarily run both during migration
- Have specialized requirements - Custom Solr plugins or Elasticsearch scripts
Enabling Legacy Search Engines
Solr (with ZooKeeper)
# Start with Solr profile
docker-compose --profile solr up -d
# Access Solr Admin UI
http://localhost:8983
# Solr runs in SolrCloud mode with ZooKeeper coordination
Services started:
- Solr (port 8983)
- ZooKeeper (port 2181)
Resource usage:
- RAM: +1GB
- Disk: +10GB (indexes)
Elasticsearch
# Start with Elasticsearch profile
docker-compose --profile elasticsearch up -d
# Access Elasticsearch API
curl http://localhost:9200
# Check cluster health
curl http://localhost:9200/_cluster/health
Services started:
- Elasticsearch (ports 9200, 9300)
Resource usage:
- RAM: +1GB (JVM heap)
- Disk: +10GB (indexes)
Both Search Engines
# Start with search profile (includes both)
docker-compose --profile search up -d
# This starts:
# - Solr + ZooKeeper
# - Elasticsearch
Configuration
Solr Configuration
solr:
profiles:
- solr
- search
image: solr:9-slim
ports:
- "8983:8983"
environment:
- SOLR_HEAP=512m
- ZK_HOST=zookeeper:2181
Adjust heap size:
environment:
- SOLR_HEAP=1g # Increase for large datasets
Elasticsearch Configuration
elasticsearch:
profiles:
- elasticsearch
- search
image: elasticsearch:8.11.3
ports:
- "9200:9200"
- "9300:9300"
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
Adjust heap size:
environment:
- "ES_JAVA_OPTS=-Xms1g -Xmx1g" # Increase for large datasets
Migration from Legacy to PostgreSQL
If you're currently using Solr or Elasticsearch and want to migrate to PostgreSQL:
Step 1: Enable PostgreSQL Search Features
PostgreSQL search is already enabled by default with pgvector and pg_trgm extensions.
Step 2: Run Both During Migration
# Run both old and new search systems
docker-compose --profile solr up -d
# PostgreSQL search is always available
# Solr runs alongside for comparison