目前,根據評分獲取結果,但我想做的是我想要一個基于評分 + 字段狀態的結果,值為 true/false。如果值為真,則需要導致優先級,但狀態字段可能不存在于所有索引中。 "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"] ] ],但出現以下錯誤:[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 default. Please use a keyword field instead. Alternatively, set fielddata=true on [status] in order to load field data by uninverting the inverted index. Note that this can use significant memory.有人幫我忽略該字段不可用的索引或解決此問題的任何其他解決方案嗎?
想要在特定字段可用或不可用的所有索引中按字段排序,如果不可用則避免它
慕尼黑5688855
2023-04-21 10:05:07