目前,根据评分获取结果但我想要做的是我想要基于评分+字段状态的结果,值为真/假。
如果值为真,则需要导致优先级,但有可能并非所有索引中都存在状态字段。
"query" => [
'bool' => [
'filter' => $filter,
'must' => [
"multi_match" => [
'query' => "$string",
"type" => "cross_fields",
'fields' => ['field1','field2','field3'],
"minimum_should_match" => "80%"
]
]
]
],
"sort" => [
"_score",
[ "status" => ["order" => "desc","unmapped_type" => "boolean"] ]
],
Run Code Online (Sandbox Code Playgroud)
但得到以下错误:
[type] => illegal_argument_exception
[reason] => Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by …Run Code Online (Sandbox Code Playgroud)