据我在ES文档中读到:
(来源:http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/custom-analyzers.html)
从这两个陈述中,我了解到执行了以下步骤:
问题:
我可能有一个char_filter一次转多个字母.
示例:ph - > f.
但是,"PH"不会变成"f",因为"PH"不是映射的一部分.
因此,对"philipp"的分析检索"filipp",而"Philipp"检索"philipp".
使用大写和小写(为了在两种情况下实现相同的结果),char_filter中的映射数将是(字符数)².
示例:ph - > f; Ph - > F; pH - > f; PH - > F.
如果我只有4个映射,我就不会有问题,但如果我需要更多的x²映射,char_filter往往会变得很乱.
索引示例:
{
"settings" : {
"index" : {
"analysis" : {
"analyzer" : {
"default_index" : {
"type" : "custom",
"tokenizer" : "whitespace",
"filter" : [
"lowercase"
],
"char_filter" : [
"misc_simplifications"
]
}
},
"char_filter" : {
"misc_simplifications" : {
"type" …Run Code Online (Sandbox Code Playgroud)