Hunspell dictionary issue installation


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

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!!

What kind of error do you get?

I suppose you already found: Hunspell Stemmer | Elasticsearch: The Definitive Guide [2.x] | Elastic

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 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(
	at org.elasticsearch.bootstrap.Security.addPath(
	at org.elasticsearch.bootstrap.Security.addFilePermissions(
	at org.elasticsearch.bootstrap.Security.createPermissions(
	at org.elasticsearch.bootstrap.Security.configure(
	at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(
	at org.elasticsearch.bootstrap.Bootstrap.setup(
	at org.elasticsearch.bootstrap.Bootstrap.init(
	at org.elasticsearch.bootstrap.Elasticsearch.main(
Refer to the log for complete error details.

this is the config I've added into Elasticsearch.yml
path.conf: /etc/Elasticsearch/config/hunspell/it_IT/it_IT.dic

this is my elastisearch.yml

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

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

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

index.number_of_shards: 1
index.number_of_replicas: 0

script.inline: on
script.indexed: on

path.conf: /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?


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.

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

did you ever solve this issue?

No, not solved do u have some suggest?

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:

1 Like