Jump to content

MediaWiki-Docker/Configuration recipes/ElasticSearch

From mediawiki.org

ElasticSearch

[edit]

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

docker-compose.override.yml

[edit]
services:
  elasticsearch:
    image: docker-registry.wikimedia.org/repos/search-platform/cirrussearch-elasticsearch-image:v7.10.2-5
    # on an Apple M1 / arm64 system, you can use kostajh/wmf-elasticsearch-arm64:7.10.2,
    # see https://gitlab.wikimedia.org/kharlan/wmf-elasticsearch-arm64/
    # image: docker.io/kostajh/wmf-elasticsearch-arm64:7.10.2
    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

[edit]

Reset elasticsearch data

[edit]
Warning Warning: this will drop all the data you stored in this elasticsearch 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