0
有沒有辦法提高從has_parent
查詢中「來」的文檔?elasticsearch:在has_parent查詢中增強文檔
{
"query": {
"function_score": {
"query": {
"bool": {
"should": [
{
"multi_match": {
"fields": ["name^3", "tags^2", "content"],
"query": "xx"
}
},
{
"has_parent": {
"type": "theparent",
"query": {
"multi_match": {
"type": "best_fields",
"fields": ["name^5", "content"],
"query": "xx"
}
}
}
},
{
"has_child": {
"type": "thechild",
"query": {
"multi_match": {
"fields": ["name^3","content"],
"query": "xx"
}
}
}
}
]
}
},
"score_mode": "sum",
"functions": [
{
"linear": {
"date": {
"origin": "2014-08-29",
"scale": "700d",
"decay": 0.6
}
}
}
]
}
}
更確切地說,我想會提高那些文檔只有當查詢父 的名稱字段匹配(我還沒有找到一種方法來引用父字段中functions
即theparent._source.name ~= "xx"
)
你說得對。我把boost參數放在了錯誤的級別。 – fxbois 2014-09-17 16:36:20