【发布时间】:2018-04-19 10:02:55
【问题描述】:
ASCII 折叠标记过滤器将“Ə”/“ə”(U+018F / U+0259) 字符折叠为“A”/“a”。我需要修改或添加折叠到“E”/“e”。 char_filter 没有帮助,也不会保留原件
添加分析器:
curl -XPUT 'localshot:9200/myix/_settings?pretty' -H 'Content-Type: application/json' -d'
{
"analysis" : {
"analyzer" : {
"default" : {
"tokenizer" : "standard",
"filter" : ["standard", "my_ascii_folding"]
}
},
"filter" : {
"my_ascii_folding" : {
"type" : "asciifolding",
"preserve_original" : true
}
}
}
}
'
测试结果:
http://localhost:9200/myix/_analyze?text=üöğıəçşi_ÜÖĞIƏÇŞİ&filter=my_ascii_folding
{
"tokens": [
{
"token": "uogiacsi_UOGIACSI",
"start_offset": 0,
"end_offset": 17,
"type": "<ALPHANUM>",
"position": 0
},
{
"token": "üöğıəçşi_ÜÖĞIƏÇŞİ",
"start_offset": 0,
"end_offset": 17,
"type": "<ALPHANUM>",
"position": 0
}
]
}
【问题讨论】:
-
我已经尝试过了,并在我的问题中指出,它不保留原件
标签: elasticsearch unicode full-text-search ascii