我的目标是能够搜索带有括号的单词,例如:
(安迪)
据我所知,如果我执行 Mapping Charfilter 并将括号更改为下划线,这将完成我所追求的。
"index" : {
"analysis" : {
"char_filter" : {
"my_mapping" : {
"type" : "mapping",
"mappings" : ["( => _", ") => _"]
}
},
"analyzer" : {
"custom_with_char_filter" : {
"tokenizer" : "standard",
"char_filter" : ["my_mapping"]
},
}
}
}
}';
当我运行上面我得到以下错误:
{"error":"ElasticSearchParseException[failed to parse source for create index]; 嵌套:JsonParseException[Unexpected character ('}' (code 125)): 期待有效的名称字符(用于未引用的名称)或双引号(用于引用)在 [Source: [B@70de7f1b; line: 15, column: 14]]; ","status":400} 处开始字段名称\n