我在 ElasticSearch 0.19.11 中有以下文档,使用:
{ "title": "dogs species",
"col_names": [ "name", "description", "country_of_origin" ],
"rows": [
{ "row": [ "Boxer", "good dog", "Germany" ] },
{ "row": [ "Irish Setter", "great dog", "Ireland" ] }
]
}
{ "title": "Misc stuff",
"col_names": [ "foo" ],
"rows": [
{ "row": [ "Setter is impotant" ] },
{ "row": [ "Ireland is green" ] }
]
}
映射如下:
{
"table" : {
"properties" : {
"title" : {"type" : "string"},
"col_names" : {"type" : "string"},
"rows" : {
"properties" : {
"row" : {"type" : "string"}
}
}
}
}
}
问题:我现在正在搜索“Ireland Setter”,对于在同一行中包含搜索词的文档,我需要获得更高的分数。
目前第二个文档得分为 0.22,而第一个文档得分为 0.14。
在这种情况下,我希望第一个文档获得更高的分数,因为它在同一行中同时包含“Ireland”和“Setter”。如何做呢?