我正在寻找以下关键词:" xiaomi redmi note 3"在我的Elasticsearch数据库中。我正在进行以下bool查询:
"filtered" : {
"query" : {
"match" : {
"name" : {
"query" : "xiaomi redmi note 3",
"type" : "boolean",
"operator" : "AND"
}
}
}
}
但是,找不到匹配项。仍然在Elasticsearch中有以下文档:
xiaomi redmi note 3 16GB 4G Phablet
为什么不符合此文件?
我一般注意到,es与keyprhase中的任何数字都不匹配?它与我使用的分析仪有关吗?
修改
"analyzer": {
"second": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"trim",
"autocomplete_filter"
]
},
我的字段的映射是:
"name" : {
"type" : "string",
"index_analyzer" : "second",
"search_analyzer" : "standard",
"fields" : {
"raw" : {
"type" : "string",
"index" : "not_analyzed"
}
},
"search_quote_analyzer" : "second"
},
Autocomplete_filter:
"autocomplete_filter": {
"type": "edge_ngram",
"min_gram": 2,
"max_gram": 10
}