Skip to main content

OpenSearch Reindexing

Background

Should OpenSearch fail and cannot be recovered from a snapshot, or after a data migration it is necessary to fully reindex the OpenSearch persons index. The index contains ~40 million records and will take 2+ hours to fully reindex.

Reindexing OpenSearch

First check you need to reindex. If you only want a new field to be returned in search results, but don’t need the field itself to be searchable, then you only need to change the hydration/serialisation in GetPersonsHandler.

Reindexing is done with the reindex-elasticsearch-{env} ECS task. You need to ensure:

  • operating system family is “Linux”
  • the cluster is set to the correct value for the environment
  • the cluster VPC is set
  • the subnets should list all private subnets
  • the security group is set to the existing search-index-ecs-{env} group

Changing the index definition

The index definition is managed by opg-search-service, and the process for changing it is described in the README.

This page was last reviewed on 16 April 2024. It needs to be reviewed again on 16 October 2024 by the page owner #opg-sirius-develop .
This page was set to be reviewed before 16 October 2024 by the page owner #opg-sirius-develop. This might mean the content is out of date.