Reindex after adding char_filter


(Kirill Teplinskiy) #1

Hello everyone!

I can't understand do I need to reindex documents after adding char_filter
to existing analyzer or not. My experiment shows char_filter starts to
work without reindex and this is surprise for me. Can anyone explain how
it works please? Here are steps of my experiment, I use ElasticSearch
0.90.13.

  1. Configure analyzer:

test1 :
tokenizer : standard
filter : [lowercase]

  1. Add thousand of documents to index:

{"name": "apple 0"}
{"name": "apple 1"}
{"name": "apple 2"}
...
{"name": "apple 999"}

Field "name" is analyzed by analyzer "test1".

  1. Add mapping char_filter to analyzer and restart ElasticSearch. This is
    char_filter configuration:

char_filter :
ab:
type: mapping
mappings: ["a=>b"]

  1. Query with text "bplle" returns results (and "apple" too)!

{
"query": {
"match": {
"name": "bpple"
}
}
}

Moreover, when I remove char_filter from analyzer it continues to find
"bplle" but stops find "apple". This confuses me too.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/312275a4-4f34-466a-a97c-8bb0d752822a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2