Elasticsearch: Examples in language analyzers reference don't work

Created on 25 Jun 2014  路  7Comments  路  Source: elastic/elasticsearch

I'm trying to create an index with an analyzer as shown here (using Python wrapper): http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-lang-analyzer.html#english-analyzer

It doesn't work as-is, raising the following exception:

[Lady Lark] [my-index] failed to create
org.elasticsearch.indices.IndexCreationException: [my-index] failed to create index
    at org.elasticsearch.indices.InternalIndicesService.createIndex(InternalIndicesService.java:300)
    at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$2.execute(MetaDataCreateIndexService.java:343)
    at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:309)
    at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:134)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.elasticsearch.ElasticsearchIllegalArgumentException: keyword filter requires either `keywords` or `keywords_path` to be configured

Without "english_keywords" or with non-empty keywords it works.

Most helpful comment

Omitting the keywords definition did the job in my case.

All 7 comments

The keywords are optional and if you don't have any keywords the whole filter should be left out. Its a documentation problem.

Hmm, wonder if we should change the docs, or make the keyword filter accept an empty array...

Is it really fixed? Copy-paste still won't work because an example contains empty "keywords", and the note is confusing: "Words can be excluded from stemming with the stem_exclusion parameter. This filter should be removed if there are no words to exclude." - what is stem_exclusion, and if the filter should be removed why is it present in example?

Yes, copy and paste won't work. I've looked at the settings parsing code and an empty array is returned as null, so we can't distinguish between an empty array and an unset parameter.

I'll work on explaining this more fully

Better?

Omitting the keywords definition did the job in my case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasontedor picture jasontedor  路  3Comments

martijnvg picture martijnvg  路  3Comments

matthughes picture matthughes  路  3Comments

abtpst picture abtpst  路  3Comments

clintongormley picture clintongormley  路  3Comments