2
탄성 검색 5.2.0에서이 필터를이 쿼리에 어떻게 추가합니까?Elasticsearch의 function_score 쿼리에 필터를 추가하는 방법 5
필자는 운이없는 필터링 된 배열로 필터를 래핑하려고했습니다.
필터
"filter" : {
"term" : { "body.category" : 1}
}
쿼리
{
"query": {
"function_score": {
"query": {
"multi_match": {
"operator": "and",
"query": "my search",
"fuzziness": 1,
"fields": [
"body.name^5",
"body.manufacturer^33",
"body.sections.name",
"body.sections.parent.name",
"body.sections.parent.parent.name"
]
}
},
"functions": [
{
"field_value_factor": {
"field": "body.rank"
}
}
],
"score_mode": "multiply"
}
}
}