MediaWiki-Docker/Configuration recipes/OpenSearch

ElasticSearch

See also: Documentation on how to set up CirrusSearch: MediaWiki-Docker/Extension/CirrusSearch

docker-compose.override.yml

services:
  elasticsearch:
    image: docker-registry.wikimedia.org/repos/search-platform/cirrussearch-opensearch-image:v1.3.20-1
    # The official image does not yet support arm64 (Apple Silicon). To run it on macOS you'll have
    # to clone the repo and build it locally. Alternatively, an unofficial arm64 image is available 
    # at docker.io/gmodena/cirrussearch-opensearch-image:1.3.20-1.
    # (digest sha256:24931ccf5f124dfecb302140faf5b58d3123da583a88e01ef9b9374ae0529b1c).
    # Browse all available versions at https://hub.docker.com/repository/docker/gmodena/cirrussearch-opensearch-image/general
    # This image is not supported, nor maintained, by either the Search Platform or Mediawiki Platform teams.
    # image: docker.io/gmodena/cirrussearch-opensearch-image:1.3.20-1
    volumes:
      - esdata:/usr/share/elasticsearch/data
    environment:
      - discovery.type=single-node
    ports:
      - 9200:9200
      - 9300:9300
    # use 127.0.0.1:9200:9200 & 127.0.0.1:9300:9300 to prevent publicly exposing the elasticsearch instance
volumes:
  esdata:
    driver: local

Operations

Reset opensearch data

Warning Warning: this will drop all the data you stored in this opensearch server
# Bring the deployment down
docker compose down
docker volume rm mediawiki_esdata
# it might complain that a container is using it so delete it the following command
# and retry the previous one
docker rm paste_the_ID_returned_by_the_previous_command

References