# Analyzer alias problem

**URL:** <https://discuss.elastic.co/t/analyzer-alias-problem/3629>\
**Category:** Elasticsearch\
**Created:** [December 4, 2010, 10:44pm UTC](https://discuss.elastic.co/t/analyzer-alias-problem/3629 "2010-12-04T22:44:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastian\_Gavarini](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sebastian\_Gavarini](https://discuss.elastic.co/u/Sebastian_Gavarini)\
**Post date:** [December 4, 2010, 10:44pm UTC](https://discuss.elastic.co/t/analyzer-alias-problem/3629/1 "2010-12-04T22:44:33Z")

</div>

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](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](http://www.elasticsearch.com/docs/elasticsearch/index_modules/analysis/analyzer/#Aliasing_Analyzers)  
and I think it's correct.

Thanks,  
Sebastian.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 5, 2010, 3:15am UTC](https://discuss.elastic.co/t/analyzer-alias-problem/3629/2 "2010-12-05T03:15:03Z")

</div>

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](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](http://www.elasticsearch.com/docs/elasticsearch/index_modules/analysis/analyzer/#Aliasing_Analyzers)  
> and I think it's correct.
> 
> Thanks,  
> Sebastian.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Gavarini](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sebastian\_Gavarini](https://discuss.elastic.co/u/Sebastian_Gavarini)\
**Post date:** [December 5, 2010, 4:18am UTC](https://discuss.elastic.co/t/analyzer-alias-problem/3629/3 "2010-12-05T04:18:34Z")

</div>

Hi Shay,

Sure, I simplified the most that I could my configuration to spot the  
problem, here it is: [Analyzer alias problem · GitHub](https://gist.github.com/728781)

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](mailto: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](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](http://www.elasticsearch.com/docs/elasticsearch/index_modules/analysi)...  
> > and I think it's correct.
> 
> > Thanks,  
> > Sebastian.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 8, 2010, 5:35pm UTC](https://discuss.elastic.co/t/analyzer-alias-problem/3629/4 "2010-12-08T17:35:46Z")

</div>

Heya,

Tracked the problem and fixed it: [Aliased analyzers cause index deletion / cleanup failure · Issue #555 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/issue/555).

-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](https://gist.github.com/728781)
> 
> 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](mailto: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](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](http://www.elasticsearch.com/docs/elasticsearch/index_modules/analysi)...  
> > > and I think it's correct.
> > 
> > > Thanks,  
> > > Sebastian.

---

<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 6, 2017, 4:15am UTC](https://discuss.elastic.co/t/analyzer-alias-problem/3629/5 "2017-07-06T04:15:30Z")

</div>


