title: Elasticsearch can't find hunspell
body: <p>I'm running elasticsearch from a docker-compose.yml file:</p>
  
  <pre><code>version: '3'
  services:
   mongo:
     image: mongo
     container_name: mongo-cust-mycom
     ports:
       - 27017:27017
     volumes:
       - cust-mycom-mongo:/data/db
     networks:
       - cust-mycom
  
   elasticsearch:
     image: docker.elastic.co/elasticsearch/elasticsearch:6.5.4
     container_name: elasticsearch-cust-mycom
     ports:
       - 9200:9200
       - 9300:9300
     volumes:
       - cust-mycom-elastic:/usr/share/elasticsearch/data
       - ./cust/config/elasticsearch/config/hunspell:/usr/share/elasticsearch/config/hunspell
     networks:
       - cust-mycom
     environment:
       - cluster.name=i3-elasticsearch
       - xpack.security.enabled=false
       - xpack.monitoring.enabled=false
       - xpack.ml.enabled=false
       - xpack.graph.enabled=false
       - xpack.watcher.enabled=false
     restart: unless-stopped
  
   kibana:
     image: docker.elastic.co/kibana/kibana:6.5.4
     container_name: kibana-cust-mycom
     ports:
       - 5601:5601
     networks:
       - cust-mycom
     depends_on:
       - elasticsearch
     restart: unless-stopped
  
  
  networks:
   cust-mycom:
     driver: bridge
  
  volumes:
   cust-mycom-mongo:
   cust-mycom-elastic:
  </code></pre>
  
  <p>using <code>docker-compose up -d</code>.</p>
  
  <p>When I try to create my desired index, using the following json:</p>
  
  <pre><code>{
      "settings": {
          "number_of_shards": 3,
          "number_of_replicas": 2,
          "analysis": {
              "filter": {
                  "swedish_stemmer": {
                      "type": "hunspell",
                      "language": "sv_SE"
                  },
                  "ins_pattern": {
                      "type": "pattern_capture",
                      "patterns": [
                          "([a-zåäö]*)(prod)"
                      ]
                  },
                  "cust_stopwords": {
                      "type":       "stop",
                      "stopwords":  [ "en", "ett", "det", "den" ]
                  }
              },
              "analyzer": {
                  "swedish_index": {
                      "tokenizer": "standard",
                      "filter": [
                          "lowercase",
                          "ins_pattern",
                          "swedish_stemmer"
                      ]
                  },
                  "swedish_query": {
                      "tokenizer": "standard",
                      "filter": [
                          "lowercase",
                          "swedish_stemmer",
                          "cust_stopwords"
                      ]
                  }
              }
          }
      },
      "mappings": {
          "default": {
              "properties": {
                  "keywords": {
                      "type": "text",
                      "store": true,
                      "norms": false,
                      "analyzer": "swedish_index",
                      "search_analyzer": "swedish_query"
                  },
                  "audience": {
                      "type": "keyword"
                  },
                  "contentExcerpt": {
                      "type": "text"
                  },
                  "date": {
                      "type": "date",
                      "store": true,
                      "format": "dateOptionalTime"
                  },
                  "validUntil": {
                      "type": "date",
                      "store": true,
                      "format": "dateOptionalTime"
                  },
                  "informationType": {
                      "type": "text",
                      "store": true,
                      "norms": false,
                      "analyzer": "swedish_index",
                      "search_analyzer": "swedish_query"
                  },
                  "mainContentOfPage": {
                      "type": "text",
                      "store": true,
                      "norms": false,
                      "analyzer": "swedish_index",
                      "search_analyzer": "swedish_query",
                      "term_vector": "with_positions_offsets"
                  },
                  "thumbnailUrl": {
                      "type": "keyword",
                      "store": true,
                      "norms": false
                  },
                  "title": {
                      "type": "text",
                      "store": true,
                      "norms": false,
                      "analyzer": "swedish_index",
                      "search_analyzer": "swedish_query"
                  },
                  "url": {
                      "type": "keyword",
                      "store": true,
                      "norms": false
                  },
                  "tags": {
                      "type": "text",
                      "store": true,
                      "norms": false,
                      "analyzer": "swedish_index",
                      "search_analyzer": "swedish_query"
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>and the following script:</p>
  
  <pre><code>#!/bin/bash
  
  curl -XDELETE http://localhost:9200/main
  curl -XPUT -H "Content-type: application/json" -d @json/custse.index.json http://localhost:9200/main
  curl -XPUT http://localhost:9200/main/_settings -H "Content-Type: application/json" -d "{
      \"index\" : {
          \"number_of_replicas\" : 0
      }
  }"
  </code></pre>
  
  <p>I get the following error message:</p>
  
  <pre><code>{"error":{"root_cause":[{"type":"illegal_state_exception","reason":"failed to load hunspell dictionary for locale: sv_SE"}]
  </code></pre>
  
  <p>I've tried putting my hunspell dictionaries in <code>/usr/share/elasticsearch/config/hunspell/</code>, <code>/usr/share/elasticsearch/hunspell</code>, <code>/etc/elasticsearch/hunspell</code> and <code>/etc/elasticsearch/config/hunspell</code>. It can't find any of them. </p>
  
  <p>Here are the contents of the hunspell file:</p>
  
  <pre><code>/etc/elasticsearch$ ls hunspell
  sv_SE
  
  /etc/elasticsearch$ ls hunspell/sv_SE/
  cust.dic  README_sv_SE.txt  sv_SE.aff  sv_SE.dic
  </code></pre>
  
  <p>How can I make elasticsearch find the hunspell dictionaries?</p>