怎么又是你

elasticsearch ik 分词器问题

Elasticsearch | 作者 _terry | 发布于2015年06月08日 | 阅读数:7002

是这样,搜索的时候指定 analyzer 为 ik 部分关键字搜不出结果,而指定 analyzer 为 standard 则有结果

以下是 query string:
{{{
{
"from": 0,
"size": 16,
"query": {
"bool": {
"must": [
{
"match": {
"city": {
"query": "深圳",
"type": "boolean",
"analyzer": "ik"
}
}
},
{
"multi_match": {
"query": "满哥甜品",
"fields": [
"t_groupon.title^4",
"t_groupon.shopName^8",
"t_groupon.category^1",
"t_groupon.parentCategory^1"
],
"analyzer": "ik",
"tie_breaker": 0.3
}
},
{
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geo_distance": {
"shopLocation": [
113.946296691895,
22.5538272857666
],
"distance": "5000m"
}
}
}
}
]
}
},
"sort": [
{
"_score": {}
},
{
"_geo_distance": {
"shopLocation": [
{
"lat": 22.5538272857666,
"lon": 113.946296691895
}
]
}
}
]
}
}}}


麻烦帮忙看下有啥问题,谢了
已邀请:

_terry

赞同来自:

背景补充:
根据关键字搜索商品信息,关键字去匹配 shopName, title 等字段
使用 ik 分词搜索,则很多关键字无搜索结果返回

yuderbin

赞同来自:

你建索引的时候没有指定使用ik分词吧?

要回复问题请先登录注册