我正在努力提高符合
应该查询
到10岁,但没用。
关键字的映射:
"KEYWORDS" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "text"
}
}
},
对于animaltype:
"animaltype" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "text"
}
}
},
当我索引数据时,我确保将其作为数组索引。
我的问题是:
GET /animals/_doc/_search
{
"query": {
"bool":{
"must":{
"terms": {
"KEYWORDS.keyword": [ "catnip"]
}
},
"should":{
"terms": {
"boost":10,
"animaltype.keyword": [ "cat"]
}
}
}
}
}
当我运行查询时,最大得分总是1.0
我需要符合动物类型“猫”的术语才能得到更高的分数。
我在这里做错什么了?