# Hunspell dictionary issue installation

**URL:** <https://discuss.elastic.co/t/hunspell-dictionary-issue-installation/53337>\
**Category:** Elasticsearch\
**Created:** [June 20, 2016, 3:36pm UTC](https://discuss.elastic.co/t/hunspell-dictionary-issue-installation/53337 "2016-06-20T15:36:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Ghisleni](https://avatars.discourse-cdn.com/v4/letter/i/5daacb/32.png) [@Ivan\_Ghisleni](https://discuss.elastic.co/u/Ivan_Ghisleni)\
**Post date:** [June 20, 2016, 3:36pm UTC](https://discuss.elastic.co/t/hunspell-dictionary-issue-installation/53337/1 "2016-06-20T15:36:48Z")

</div>

Hi,

I'm trying to install hunspell dictionary for italian language but I don't know where set the dictionary path.

Configuration:  
Os: CentOS 6.5  
Elasticsearch: 2.1.0 - path: /etc/elasticsearch

I put all the dictionaries into /etc/elasticsearch/config/hunspell/it\_IT

- it\_IT.aff
- it\_IT.dic

I don't know how to add the dictionary into configuration elasticsearch.yml  
I've tried with this config into elasticsearch.yml:  
path.conf: /etc/elasticsearch/config/hunspell/it\_IT/it\_IT.dic

but when I restart the service I've got error.

Please help me!!

---

<div class="post-metadata">

**Author:** ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)\
**Post date:** [June 20, 2016, 4:15pm UTC](https://discuss.elastic.co/t/hunspell-dictionary-issue-installation/53337/2 "2016-06-20T16:15:37Z")

</div>

> [@Ivan\_Ghisleni](#):
>
> but when I restart the service I've got error.

What kind of error do you get?

I suppose you already found: [Hunspell Stemmer | Elasticsearch: The Definitive Guide [2.x] | Elastic](https://www.elastic.co/guide/en/elasticsearch/guide/current/hunspell.html)

---

<div class="post-metadata">

**Author:** ![Ivan\_Ghisleni](https://avatars.discourse-cdn.com/v4/letter/i/5daacb/32.png) [@Ivan\_Ghisleni](https://discuss.elastic.co/u/Ivan_Ghisleni)\
**Post date:** [June 21, 2016, 8:52am UTC](https://discuss.elastic.co/t/hunspell-dictionary-issue-installation/53337/3 "2016-06-21T08:52:50Z")

</div>

> [@Ivan\_Ghisleni](#):
>
> path.conf: /etc/elasticsearch/config/hunspell/it\_IT/it\_IT.dic

This is the error i get

```
Avvio di elasticsearch: log4j:WARN No appenders could be found for logger (bootstrap).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.lang.IllegalStateException: Unable to access 'path.conf' (/etc/elasticsearch/config/hunspell/it_IT/it_IT.dic)
Likely root cause: java.nio.file.NotDirectoryException: /etc/elasticsearch/config/hunspell/it_IT/it_IT.dic
	at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:253)
	at org.elasticsearch.bootstrap.Security.addPath(Security.java:227)
	at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:194)
	at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:184)
	at org.elasticsearch.bootstrap.Security.configure(Security.java:105)
	at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:196)
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167)
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
                                                           [FALLITO]

```

this is the config I've added into elasticsearch.yml  
path.conf: /etc/elasticsearch/config/hunspell/it\_IT/it\_IT.dic

---

<div class="post-metadata">

**Author:** ![Ivan\_Ghisleni](https://avatars.discourse-cdn.com/v4/letter/i/5daacb/32.png) [@Ivan\_Ghisleni](https://discuss.elastic.co/u/Ivan_Ghisleni)\
**Post date:** [June 21, 2016, 8:58am UTC](https://discuss.elastic.co/t/hunspell-dictionary-issue-installation/53337/4 "2016-06-21T08:58:16Z")

</div>

this is my elastisearch.yml

```
# Use a descriptive name for the node:
node.name: "Elastic Netweek Local"

# Path to directory where to store the data (separate multiple locations by comma):
path.data: /var/elasticsearch/data

# Path to log files:
path.logs: /var/elasticsearch/logs

# TESTING PARAMS
index.number_of_shards: 1
index.number_of_replicas: 0

# ENABLE DYNAMIC SCRIPTS
script.inline: on
script.indexed: on

path.conf: /etc/elasticsearch/config/hunspell/it_IT/it_IT.dic
```

---

<div class="post-metadata">

**Author:** ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)\
**Post date:** [June 21, 2016, 9:18am UTC](https://discuss.elastic.co/t/hunspell-dictionary-issue-installation/53337/5 "2016-06-21T09:18:09Z")

</div>

> [@Ivan\_Ghisleni](#):
>
> Exception in thread "main" java.lang.IllegalStateException: Unable to access 'path.conf' (/etc/elasticsearch/config/hunspell/it\_IT/it\_IT.dic)  
> Likely root cause: java.nio.file.NotDirectoryException: /etc/elasticsearch/config/hunspell/it\_IT/it\_IT.dic

Did you check that the directory listed in the error message exists and is readable by whatever user your elasticsearch instance runs as?

Isabel

---

<div class="post-metadata">

**Author:** ![Ivan\_Ghisleni](https://avatars.discourse-cdn.com/v4/letter/i/5daacb/32.png) [@Ivan\_Ghisleni](https://discuss.elastic.co/u/Ivan_Ghisleni)\
**Post date:** [June 21, 2016, 10:19am UTC](https://discuss.elastic.co/t/hunspell-dictionary-issue-installation/53337/6 "2016-06-21T10:19:37Z")

</div>

I had the same idea, so I've set the path /etc/elasticsearch/config to 777 permissions but nothing changes.  
I start the service as root, so I should not have problems of permissions, but the error is the same....

I don't know what error I'm committing.

---

<div class="post-metadata">

**Author:** ![Ivan\_Ghisleni](https://avatars.discourse-cdn.com/v4/letter/i/5daacb/32.png) [@Ivan\_Ghisleni](https://discuss.elastic.co/u/Ivan_Ghisleni)\
**Post date:** [June 21, 2016, 3:56pm UTC](https://discuss.elastic.co/t/hunspell-dictionary-issue-installation/53337/7 "2016-06-21T15:56:45Z")

</div>

I'm using Elasticsearch 2.1 reading the setting changest from 1.x to 2.x I sow that:

```
Hunspell dictionary configuration
The parameter indices.analysis.hunspell.dictionary.location has been removed, and <path.conf>/hunspell is always used.

```

So it seems that if I put the dictionary into /etc/elasticsearch/config/hunspell/it\_IT/it\_IT.dic|it\_IT.aff  
Elastic load directly......

But if I make the post request for creating the index

```
{
    "analysis" : {
        "analyzer" : {
            "en" : {
                "tokenizer" : "standard",
                "filter" : ["lowercase", "it_IT"]
            }
        },
        "filter" : {
            "en_US" : {
                "type" : "hunspell",
                "locale" : "it_IT",
                "dedup" : true
            }
        }
    }
}

```

the response is :

```
{
  "error": {
    "root_cause": [
      {
        "type": "index_creation_exception",
        "reason": "failed to create index"
      }
    ],
    "type": "unchecked_execution_exception",
    "reason": "ElasticsearchException[Could not find hunspell dictionary [en_US]]",
    "caused_by": {
      "type": "exception",
      "reason": "Could not find hunspell dictionary [en_US]"
    }
  },
  "status": 500
}
```

---

<div class="post-metadata">

**Author:** ![animageofmine](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@animageofmine](https://discuss.elastic.co/u/animageofmine)\
**Post date:** [January 6, 2017, 9:32pm UTC](https://discuss.elastic.co/t/hunspell-dictionary-issue-installation/53337/8 "2017-01-06T21:32:01Z")

</div>

did you ever solve this issue?

---

<div class="post-metadata">

**Author:** ![Ivan\_Ghisleni](https://avatars.discourse-cdn.com/v4/letter/i/5daacb/32.png) [@Ivan\_Ghisleni](https://discuss.elastic.co/u/Ivan_Ghisleni)\
**Post date:** [January 9, 2017, 9:34am UTC](https://discuss.elastic.co/t/hunspell-dictionary-issue-installation/53337/9 "2017-01-09T09:34:34Z")

</div>

No, not solved do u have some suggest?

---

<div class="post-metadata">

**Author:** ![animageofmine](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@animageofmine](https://discuss.elastic.co/u/animageofmine)\
**Post date:** [January 9, 2017, 4:48pm UTC](https://discuss.elastic.co/t/hunspell-dictionary-issue-installation/53337/10 "2017-01-09T16:48:13Z")

</div>

Yes, I just solved this last Friday.

Copy the Hunspell folder under /etc/elasticsearch and not under /etc/elasticsearch/config. Make sure it has right permissions (chown if required). I am assuming that you didn't override the default config directory which is /etc/elasticsearch.

See my reply here: [http://stackoverflow.com/questions/37168208/hunspell-for-elasticsearch/41517146#41517146](http://stackoverflow.com/questions/37168208/hunspell-for-elasticsearch/41517146#41517146)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:04pm UTC](https://discuss.elastic.co/t/hunspell-dictionary-issue-installation/53337/11 "2017-07-05T22:04:23Z")

</div>


