Skip to content
Mark Johnson edited this page Mar 30, 2023 · 1 revision

Testing

You can test the plugin locally by running Elasticsearch or OpenSearch in a Docker container. OpenSearch and newer versions of Elasticsearch have SSL enabled by default with a self-signed certificate, so to avoid issues when testing you can apply configuration that disables this and use plain HTTP. Example configuration files and docker-compose configuration are below.

Once your container is running, set the container's hostname (elasticsearch or opensearch below) in Site Administration > Plugins > Search > Elastic.

If you have $CFG->proxyhost set, add your search container's hostname to $CFG->proxybypass.

Elasticsearch

docker-compose.yml

services:
  ...
  elasticsearch:
    image: elasticsearch:8.5.3
    environment:
      - discovery.type=single-node
    volumes:  
      - /path/to/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml

elasticsearch.yml

cluster.name: "docker-cluster"
network.host: 0.0.0.0

# Enable security features
xpack.security.enabled: false

xpack.security.enrollment.enabled: false

# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
  enabled: false

# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
  enabled: false

Opensearch

docker-compose.yml

services:
  ...
  opensearch:
    image: opensearchproject/opensearch:2.4.1
    environment:
      - discovery.type=single-node
    volumes:  
      - /path/to/opensearch.yml:/usr/share/opensearch/config/opensearch.yml

opensearch.yml

---
cluster.name: docker-cluster

# Bind to all interfaces because we don't know what IP address Docker will assign to us.
network.host: 0.0.0.0

plugins.security.disabled: true
node.max_local_storage_nodes: 3