Analyzer alias problem

Hi all,

I am seeing what could be a bug with analyzer aliases, for the sake of
the example the lines that I have in elasticsearch.yml are:

analysis:
    analyzer:
        all_analyzer:
            alias: [index_all_analyzer, search_all_analyzer]
            type: custom
            ....

If I add a simple document to it with:
curl -XPUT 'http://sd:5100/indexX/typeY/idZ' -d '{"title":"an
example"}'

I see in ES console:
Exception in thread "elasticsearch[Green
Goblin]clusterService#updateTask-pool-5-thread-1"
java.lang.NullPointerException
at org.apache.lucene.analysis.Analyzer.close(Analyzer.java:
141)
at
org.elasticsearch.index.analysis.NamedAnalyzer.close(NamedAnalyzer.java:
93)
at
org.elasticsearch.index.analysis.AnalysisService.close(AnalysisService.java:
163)
at
org.elasticsearch.indices.InternalIndicesService.deleteIndex(InternalIndicesService.java:
285)
at
org.elasticsearch.indices.InternalIndicesService.cleanIndex(InternalIndicesService.java:
249)
at
org.elasticsearch.indices.cluster.IndicesClusterStateService.applyCleanedIndices(IndicesClusterStateService.java:
137)
at
org.elasticsearch.indices.cluster.IndicesClusterStateService.clusterChanged(IndicesClusterStateService.java:
126)
at org.elasticsearch.cluster.service.InternalClusterService
$2.run(InternalClusterService.java:214)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)

If I comment the alias line everything works fine.

As a side note I am using explicit mappings for the fields, dynamic
ones to false, so "title" uses the alias in the example.

So, I am using this in a wrong way? is that feature broken anyhow? I
checked the docs: http://www.elasticsearch.com/docs/elasticsearch/index_modules/analysis/analyzer/#Aliasing_Analyzers
and I think it's correct.

Thanks,
Sebastian.

Can you gist a full recreation?
On Sunday, December 5, 2010 at 12:44 AM, Sebastian wrote:

Hi all,

I am seeing what could be a bug with analyzer aliases, for the sake of
the example the lines that I have in elasticsearch.yml are:

analysis:
analyzer:
all_analyzer:
alias: [index_all_analyzer, search_all_analyzer]
type: custom
....

If I add a simple document to it with:
curl -XPUT 'http://sd:5100/indexX/typeY/idZ' -d '{"title":"an
example"}'

I see in ES console:
Exception in thread "elasticsearch[Green
Goblin]clusterService#updateTask-pool-5-thread-1"
java.lang.NullPointerException
at org.apache.lucene.analysis.Analyzer.close(Analyzer.java:
141)
at
org.elasticsearch.index.analysis.NamedAnalyzer.close(NamedAnalyzer.java:
93)
at
org.elasticsearch.index.analysis.AnalysisService.close(AnalysisService.java:
163)
at
org.elasticsearch.indices.InternalIndicesService.deleteIndex(InternalIndicesService.java:
285)
at
org.elasticsearch.indices.InternalIndicesService.cleanIndex(InternalIndicesService.java:
249)
at
org.elasticsearch.indices.cluster.IndicesClusterStateService.applyCleanedIndices(IndicesClusterStateService.java:
137)
at
org.elasticsearch.indices.cluster.IndicesClusterStateService.clusterChanged(IndicesClusterStateService.java:
126)
at org.elasticsearch.cluster.service.InternalClusterService
$2.run(InternalClusterService.java:214)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)

If I comment the alias line everything works fine.

As a side note I am using explicit mappings for the fields, dynamic
ones to false, so "title" uses the alias in the example.

So, I am using this in a wrong way? is that feature broken anyhow? I
checked the docs: Analysis | Elasticsearch Guide [8.11] | Elastic
and I think it's correct.

Thanks,
Sebastian.

Hi Shay,

Sure, I simplified the most that I could my configuration to spot the
problem, here it is: Analyzer alias problem · GitHub

I used a fresh new ES 0.13.1 version, just added the gisted
elasticsearch.yml

It works ok just as it is, but if you want to see the error uncomment
the analyzer alias line, in my case that caused the problem. The
document I am trying to add uses the default name of the analyzer, not
even any of the aliases, but it fails anyway.

Sebastian.

On Dec 5, 12:15 am, Shay Banon shay.ba...@elasticsearch.com wrote:

Can you gist a full recreation?

On Sunday, December 5, 2010 at 12:44 AM, Sebastian wrote:

Hi all,

I am seeing what could be a bug with analyzer aliases, for the sake of
the example the lines that I have in elasticsearch.yml are:

analysis:
analyzer:
all_analyzer:
alias: [index_all_analyzer, search_all_analyzer]
type: custom
....

If I add a simple document to it with:
curl -XPUT 'http://sd:5100/indexX/typeY/idZ'-d '{"title":"an
example"}'

I see in ES console:
Exception in thread "elasticsearch[Green
Goblin]clusterService#updateTask-pool-5-thread-1"
java.lang.NullPointerException
at org.apache.lucene.analysis.Analyzer.close(Analyzer.java:
141)
at
org.elasticsearch.index.analysis.NamedAnalyzer.close(NamedAnalyzer.java:
93)
at
org.elasticsearch.index.analysis.AnalysisService.close(AnalysisService.java :
163)
at
org.elasticsearch.indices.InternalIndicesService.deleteIndex(InternalIndice sService.java:
285)
at
org.elasticsearch.indices.InternalIndicesService.cleanIndex(InternalIndices Service.java:
249)
at
org.elasticsearch.indices.cluster.IndicesClusterStateService.applyCleanedIn dices(IndicesClusterStateService.java:
137)
at
org.elasticsearch.indices.cluster.IndicesClusterStateService.clusterChanged (IndicesClusterStateService.java:
126)
at org.elasticsearch.cluster.service.InternalClusterService
$2.run(InternalClusterService.java:214)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)

If I comment the alias line everything works fine.

As a side note I am using explicit mappings for the fields, dynamic
ones to false, so "title" uses the alias in the example.

So, I am using this in a wrong way? is that feature broken anyhow? I
checked the docs:http://www.elasticsearch.com/docs/elasticsearch/index_modules/analysi...
and I think it's correct.

Thanks,
Sebastian.

Heya,

Tracked the problem and fixed it: Aliased analyzers cause index deletion / cleanup failure · Issue #555 · elastic/elasticsearch · GitHub.

-shay.banon
On Sunday, December 5, 2010 at 6:18 AM, Sebastian wrote:

Hi Shay,

Sure, I simplified the most that I could my configuration to spot the
problem, here it is: Analyzer alias problem · GitHub

I used a fresh new ES 0.13.1 version, just added the gisted
elasticsearch.yml

It works ok just as it is, but if you want to see the error uncomment
the analyzer alias line, in my case that caused the problem. The
document I am trying to add uses the default name of the analyzer, not
even any of the aliases, but it fails anyway.

Sebastian.

On Dec 5, 12:15 am, Shay Banon shay.ba...@elasticsearch.com wrote:

Can you gist a full recreation?

On Sunday, December 5, 2010 at 12:44 AM, Sebastian wrote:

Hi all,

I am seeing what could be a bug with analyzer aliases, for the sake of
the example the lines that I have in elasticsearch.yml are:

analysis:
analyzer:
all_analyzer:
alias: [index_all_analyzer, search_all_analyzer]
type: custom
....

If I add a simple document to it with:
curl -XPUT 'http://sd:5100/indexX/typeY/idZ'-d '{"title":"an
example"}'

I see in ES console:
Exception in thread "elasticsearch[Green
Goblin]clusterService#updateTask-pool-5-thread-1"
java.lang.NullPointerException
at org.apache.lucene.analysis.Analyzer.close(Analyzer.java:
141)
at
org.elasticsearch.index.analysis.NamedAnalyzer.close(NamedAnalyzer.java:
93)
at
org.elasticsearch.index.analysis.AnalysisService.close(AnalysisService.java :
163)
at
org.elasticsearch.indices.InternalIndicesService.deleteIndex(InternalIndice sService.java:
285)
at
org.elasticsearch.indices.InternalIndicesService.cleanIndex(InternalIndices Service.java:
249)
at
org.elasticsearch.indices.cluster.IndicesClusterStateService.applyCleanedIn dices(IndicesClusterStateService.java:
137)
at
org.elasticsearch.indices.cluster.IndicesClusterStateService.clusterChanged (IndicesClusterStateService.java:
126)
at org.elasticsearch.cluster.service.InternalClusterService
$2.run(InternalClusterService.java:214)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)

If I comment the alias line everything works fine.

As a side note I am using explicit mappings for the fields, dynamic
ones to false, so "title" uses the alias in the example.

So, I am using this in a wrong way? is that feature broken anyhow? I
checked the docs:http://www.elasticsearch.com/docs/elasticsearch/index_modules/analysi...
and I think it's correct.

Thanks,
Sebastian.