"settings":{
"analysis": {
"char_filter": {
"char_filter": {
"pattern": "[^A-Za-z0-9\u00C0-\u00FF]",
"type": "pattern_replace",
"replacement": ""
}
},
"normalizer": {
"normalizer": {
"type": "custom",
"char_filter": "char_filter",
"filter": ["trim", "lowercase", "asciifolding"]
}
}
}
}
}
映射:
{
"properties": {
"id":{ "type": "integer" },
"a":{"type":"keyword", "normalizer": "normalizer"},
"b":{"type":"keyword"}
}
}
文件:
{
"id":1,
"a":"one",
"b":"one"
}
{
"id":2,
"a":"two",
"b":"two"
}
{
"id":3,
"a":"three",
"b":"three"
}
这个查询
{"query":{"bool":{"must":[{"wildcard":{"b":"t*"}}]}}}
正如预期的那样匹配两个文档,但是
{"query":{"bool":{"must":[{"wildcard":{"a":"t*"}}]}}}
不匹配。这是怎么回事?
看起来您的帖子主要是代码;请添加更多细节。Lorem ipsum dolor sit amet, consectetur adipiscing elit。Aliquam quis turpis sagittis, blandit massa sed, tristique turpis。