Disappearing Analyzer

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

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:

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
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

--