原英文版地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/rank-features.html, 原文档版权归 www.elastic.co 所有
本地英文版地址: ../en/rank-features.html
本地英文版地址: ../en/rank-features.html
重要: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 当前版本文档。
rank_features字段可以对数字特征向量进行索引,以便稍后可以使用它们在具有rank_feature查询的查询中提升文档。
它类似于rank_feature数据类型,但更适合于特征列表稀疏的情况,因此没有理由为每个特征的映射添加一个字段。
PUT my_index
{
"mappings": {
"properties": {
"topics": {
"type": "rank_features"
}
}
}
}
PUT my_index/_doc/1
{
"topics": {
"politics": 20,
"economics": 50.8
}
}
PUT my_index/_doc/2
{
"topics": {
"politics": 5.2,
"sports": 80.1
}
}
GET my_index/_search
{
"query": {
"rank_feature": {
"field": "topics.politics"
}
}
}
rank_features字段仅支持单值特征和严格的正数值。
多值字段和零或负值将被拒绝。
rank_features字段不支持排序和聚合,只能使用rank_feature查询来查询(只能在rank_feature查询内部使用)。
rank_features字段仅保留9个有效位的精度,这相当于大约0.4%的相对误差。