Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
<img src="//i.stack.imgur.com/RUiNP.png" height="16" width="18" alt="" class="sponsor tag img">elasticsearch 如何在值或应用条件上限制字段值因子?_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Search - Fatal编程技术网 elasticsearch 如何在值或应用条件上限制字段值因子?,elasticsearch,search,elasticsearch,Search" /> elasticsearch 如何在值或应用条件上限制字段值因子?,elasticsearch,search,elasticsearch,Search" />

elasticsearch 如何在值或应用条件上限制字段值因子?

elasticsearch 如何在值或应用条件上限制字段值因子?,elasticsearch,search,elasticsearch,Search,只有当值在某个范围内时,我才需要应用带有修饰符的字段值因子。 例如, { "field_value_factor": { "field": "ProductScore", "modifier": "square", "missing": 1, "factor": 20 } } 仅当ProductScore在指定范围内时,才应应用此选项,否则应跳

只有当值在某个范围内时,我才需要应用带有修饰符的字段值因子。 例如,

{
 "field_value_factor": {
 "field": "ProductScore",
 "modifier": "square",
 "missing": 1,
 "factor": 20
 }
}

仅当ProductScore在指定范围内时,才应应用此选项,否则应跳过此选项。

您可以将函数\u分数查询包装在bool查询中(作为一个shoul子句),并使用bool的filter子句应用指定范围检查