版本为Elasticsearch2.4.0
索引时配置了支付宝的weight为10000,支农宝的weight为8000,支学宝的weight为5000
mapping为:
"mysuggest": {
"type": "completion",
"analyzer": "keyword",
"search_analyzer": "keyword",
"payloads": false
},
查询DSL:
{
"query": {},
"suggest": {
"my-suggqest": {
"text": "支寸宝",
"completion": {
"size": 3,
"field": "mysuggest",
"fuzzy": {
"fuzziness": 2
}
}
}
}
}
当text为“支存宝”时,返回数据为:
{
"text": "支付宝",
"score": 10000
}
,
{
"text": "支农宝",
"score": 8000
}
,
{
"text": "支学宝",
"score": 5000
}
当text为“支寸宝”时,搜索返回为:
{
"text": "支农宝",
"score": 8000
}
,
{
"text": "支学宝",
"score": 5000
}
没有“支付宝”了。想问下,这个是啥原因??
索引时配置了支付宝的weight为10000,支农宝的weight为8000,支学宝的weight为5000
mapping为:
"mysuggest": {
"type": "completion",
"analyzer": "keyword",
"search_analyzer": "keyword",
"payloads": false
},
查询DSL:
{
"query": {},
"suggest": {
"my-suggqest": {
"text": "支寸宝",
"completion": {
"size": 3,
"field": "mysuggest",
"fuzzy": {
"fuzziness": 2
}
}
}
}
}
当text为“支存宝”时,返回数据为:
{
"text": "支付宝",
"score": 10000
}
,
{
"text": "支农宝",
"score": 8000
}
,
{
"text": "支学宝",
"score": 5000
}
当text为“支寸宝”时,搜索返回为:
{
"text": "支农宝",
"score": 8000
}
,
{
"text": "支学宝",
"score": 5000
}
没有“支付宝”了。想问下,这个是啥原因??
0 个回复