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