Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

OpenSearch Reindexing Guide

Manual reindexing for OpenSearch indices using the helper pod (contains OpenSearch client tools and the application environment).

Prerequisites

  • kubectl installed
  • Cluster access (kubectl can reach the target EKS cluster)
  • Helper pod permissions

Access Helper Pod

# Switch to the target Kubernetes context
kubectl config use-context <context-name>

# List pods
kubectl get pods -n hungryhub

# Access helper pod shell (replace pod name)
kubectl exec -it <helper-pod-name> -n hungryhub -- /bin/sh

Get the current pod name with: kubectl get pods -n hungryhub -l app=helper -o jsonpath='{.items[0].metadata.name}'

Use kubectl config get-contexts to list available contexts.

Reindex Commands

After accessing the pod shell (from previous section):

⚠️ Important: Reindex restaurants before inventories because inventory data references restaurant IDs.

# Reindex restaurants
bin/rake reindex_schema:restaurants

# Reindex inventories
bin/rake reindex_schema:inventories

# Reindex restaurant tags
bin/rake reindex_schema:restaurant_tags

If reindexing fails, check the pod logs and re-run the command (commands are idempotent).

Note: Reindexing may take 10-15 minutes per index and can impact search performance.

Verify Reindexing

Inside the pod shell, check the index status:

curl localhost:9200/_cat/indices