I am developing an ES Plugin which contains a new analyzer and a new filter. My elasticsearch.yml file is as follows- :
index:
analysis:
analyzer:
ik_syno:
tokenizer: ik
filter: [my_synonym_filter_ik]
ik_syno_smart:
tokenizer: ik_smart
filter: [my_synonym_filter_ik_smart]
filter:
my_synonym_filter_ik_smart:
type: org.elasticsearch.index.analysis.SynonymcnTokenFilterFactory
use_smart: true
my_synonym_filter_ik:
type: org.elasticsearch.index.analysis.SynonymcnTokenFilterFactory
use_smart: true
SynonymcnTokenFilterFactory is my class.
Now,when i use
http://127.0.0.1:9200/newshuoshuo/_analyze?analyzer=ik_syno_smart&pretty=true
the analyzer 'ik_syno_smart' works as expected.
{
"tokens" : [ {
"token" : "hello",
"start_offset" : 1,
"end_offset" : 6,
"type" : "ENGLISH",
"position" : 1
} ]
}
But when i use it in my mappings call, it returns error.
This is my index field
"content": {
"type": "string",
"index_analyzer": "ik_syno_smart",
"search_analyzer": "ik_smart",
"boost": "10"
},
The error log is as follows:
on [shard failure [failed to update mappings][MapperParsingException[Analyzer [ik_syno_smart] not found for field [content]]]]
What is it that I'm doing wrong? My ES version is 1.7.0.