# Disappearing Analyzer

**URL:** https://discuss.elastic.co/t/disappearing-analyzer/8795
**Category:** Elasticsearch
**Created:** [August 21, 2012, 12:42am UTC](https://discuss.elastic.co/t/disappearing-analyzer/8795 "2012-08-21T00:42:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Kevin\_Lawrence](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevin_lawrence/32/1951_2.png) [@Kevin\_Lawrence](https://discuss.elastic.co/u/Kevin_Lawrence)
#### Post date: [August 21, 2012, 12:42am UTC](https://discuss.elastic.co/t/disappearing-analyzer/8795/1 "2012-08-21T00:42:18Z")

</div>

I have a python script that creates a new index and a mapping using Pyes. At the same time as I create the index, I also create an analyzer.

Heres the Python to create the index:

INDEX\_SETTINGS = {  
'analysis' : {  
'analyzer' : {  
'lowercase\_keyword' : {  
"type" : "custom",  
"tokenizer" : "keyword",  
"filter" : ["lowercase", "trim"]  
}  
}  
}  
}

es = ES('localhost:9200')  
es.create\_index\_if\_missing(index\_name, INDEX\_SETTINGS)

Everything works fine until the machine gets rebooted or the Elastic Search service gets restarted. After a reboot, the index and the mapping are still there, but all my filters stop working as if the analyzer does not exist. If I query the \_settings of my index, I can see the analyzer but it seems to have no effect.

What am I doing wrong?

Thanks in advance,

Kevin

---

<div class="post-metadata">

### Author: ![Kevin\_Lawrence](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevin_lawrence/32/1951_2.png) [@Kevin\_Lawrence](https://discuss.elastic.co/u/Kevin_Lawrence)
#### Post date: [August 21, 2012, 7:04pm UTC](https://discuss.elastic.co/t/disappearing-analyzer/8795/2 "2012-08-21T19:04:17Z")

</div>

A couple more days of debugging and I have learned:

- The behavior is the same whether I use the Python client or the REST  
client
- I can't reproduce the behavior in a simpler test case
- It might be related to the fact that I am trying to filter on a nested  
document.

This issue (closed two years ago) seems tantalizingly close:

> <https://github.com/elastic/elasticsearch/issues/484>
>
> document level analyzer (analyzer, index\_analyzer, search\_analyzer) are not seri…alized (and not maintained across restarts)

document level analyzer (analyzer, index\_analyzer, search\_analyzer) are not  
serialized (and not maintained across restarts)

I'm interested in tips to debug my problem or workarounds. ie., once the  
problem occurs, how to rememdy it. RIght now, my only rememdy is to  
completely re-index all the data.

Thanks in advance,

Kevin

On Monday, August 20, 2012 5:42:19 PM UTC-7, Kevin Lawrence wrote:

> I have a python script that creates a new index and a mapping using Pyes.  
> At  
> the same time as I create the index, I also create an analyzer.
> 
> Heres the Python to create the index:
> 
> INDEX\_SETTINGS = {  
> 'analysis' : {  
> 'analyzer' : {  
> 'lowercase\_keyword' : {  
> "type" : "custom",  
> "tokenizer" : "keyword",  
> "filter" : ["lowercase", "trim"]  
> }  
> }  
> }  
> }
> 
> es = ES('localhost:9200')  
> es.create\_index\_if\_missing(index\_name, INDEX\_SETTINGS)
> 
> Everything works fine until the machine gets rebooted or the Elastic  
> Search  
> service gets restarted. After a reboot, the index and the mapping are  
> still  
> there, but all my filters stop working as if the analyzer does not exist.  
> If  
> I query the \_settings of my index, I can see the analyzer but it seems to  
> have no effect.
> 
> What am I doing wrong?
> 
> Thanks in advance,
> 
> Kevin
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Disappearing-Analyzer-tp4021919.html](http://elasticsearch-users.115913.n3.nabble.com/Disappearing-Analyzer-tp4021919.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--

---

<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, 3:15am UTC](https://discuss.elastic.co/t/disappearing-analyzer/8795/3 "2017-07-06T03:15:36Z")

</div>


