是否可以在此表单的查询中提升字段?
"query": {
"filtered": {
"query": {
"query_string": {
"query": "the user's search query",
"fields": ["name", "description"],
"default_operator": "OR"
}
},
"filter": {...}
}
}
答案 0 :(得分:12)
是的,只需在字段(名称^ 5)上添加boost语法,例如:
"query": {
"filtered": {
"query": {
"query_string": {
"query": "the user's search query",
"fields": ["name^5", "description"],
"default_operator": "OR"
}
},
"filter": {...}
}
}