当前位置:   article > 正文

Elasticsearch使用function_score查询酒店和排序,2024年最新三面美团大数据开发岗_elasticsearch中使用randomscorefunction

elasticsearch中使用randomscorefunction

先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7

深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年最新大数据全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

如果你需要这些资料,可以添加V获取:vip204888 (备注大数据)
img

正文

        "max\_boost": 100,
        "functions": [
            // 酒店类型(依赖用户历史数据)
            {
                "filter": {
                    // 根据历史数据,不同关键词设置权重“青年旅舍”权重1,“青年公寓”权重2,“酒店公寓”权重3
                    "query\_string": {
                        "query": "hotelName:(\"青年旅舍\"^0.1 or \"青年公寓\"^0.1 or \"酒店公寓\"^0.2)"
                    }
                },
                // 生成从 0 到但不包括 1 均匀分布的分数(非必填),默认情况下,它使用内部 Lucene 文档 ID 作为随机源
                "random\_score": {
                    // 使用\_seq\_no字段作为随机源,唯一的缺点是如果文档已更新,则分数将会更改
                    "field": "\_seq\_no",
                    "seed": 10
                },
                "weight": 3
            },
            // 衰减函数(DECAY\_FUNCTION )-geo 地理位置评分
            {
                // gauss 正常衰减
                "gauss": {
                    // 在origin上偏移offset后随着scale进行衰减
                    "gdLocation": {
                        // 用于计算距离的原点 lon,lat(经纬度)
                        "origin": "113.324994,23.150261",
                        // 定义计算得分等于衰减参数时距原点 + 偏移量的距离
                        "scale": "2km",
                        // 如果定义了offset,则衰减函数将仅计算距离大于offset的文档的衰减函数。默认值为 0。
                        "offset": "1km",
                        //衰减参数定义如何在给定scale的距离上对文档进行评分。如果未定义衰减,则距离scale上的文档将评分为 0.5。
                        "decay": "0.33"
                    }
                },
                "weight": 20
            },
            //价格排序(依赖历史数据,缺省 150)
            {
                "gauss": {
                    // 在150元基础上偏移30元在100元范围内衰减
                    "minPrice": {
                        "origin": 150,
                        "offset": 0,
                        "scale": 50
                    }
                },
                "weight": 15
            },
            // 酒店评分
            {
                "gauss": {
                    "commentPoint": {
                        "origin": 5,
                        "offset": 1,
                        "scale": 2
                    }
                },
                "weight": 10
            }
        ],
        // functions函数的分数与查询的分数相结合
        // multiply:查询得分与functions得分相乘(默认)、replace:仅使用functions得分,忽略查询得分、sum:查询得分与functions得分相加、avg:平均、max:查询得分和functions得分的最大值、min:查询得分和functions得分的最小值
        "boost\_mode": "replace",
        // Score\_mode 指定如何组合计算functions函数的分数
        // multiply(默认)分数相乘、sum分数相加、avg:分数被平均、max:使用最高分数、min:使用最低分数
        "score\_mode": "sum",
        // 默认情况下,修改分数不会更改匹配的文档。要排除不满足特定分数阈值的文档,可以将 min\_score 参数设置为所需的分数阈值。
        "min\_score": 0
    }
},
// 返回距离
"script\_fields": {
    "distance\_in\_m": {
        "script": "doc['gdLocation'].arcDistance(23.150261,113.324994)"
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76

}


查询结果:



  • 1
  • 2
  • 3
  • 4
  • 5

{
“took”: 35,
“timed_out”: false,
“_shards”: {
“total”: 1,
“successful”: 1,
“skipped”: 0,
“failed”: 0
},
“hits”: {
“total”: {
“value”: 3244,
“relation”: “eq”
},
“max_score”: 27.109045,
“hits”: [
{
“_shard”: “[hotel_test][0]”,
“_node”: “cdYh0ptNTP6kMXlVSE8dqA”,
“_index”: “hotel_test”,
“_type”: “_doc”,
“_id”: “HCIc1I0BqMZKQzdgx805”,
“_score”: 27.109045,
“_source”: {
“gdLocation”: {
“lon”: “113.318928”,
“lat”: “23.118031”
},
“address”: “华利路172号”,
“cityName”: “广州市”,
“commentPoint”: 3.7,
“minPrice”: 149.0,
“hotelName”: “美佳酒店公寓(广州星辰大厦店)”
},
“fields”: {
“distance_in_m”: [
3637.0993194146326
]
},
“_explanation”: {
“value”: 27.109045,
“description”: “min of:”,
“details”: [
{
“value”: 27.109045,
“description”: “function score, score mode [sum]”,
“details”: [
{
“value”: 2.2679522,
“description”: “function score, product of:”,
“details”: [
{
“value”: 1.0,
“description”: “match filter: (hotelName:“酒 店 公 寓”)^0.2 (hotelName:“青 年 旅 舍”)^0.1 (hotelName:or)^2.0 (hotelName:“青 年 公 寓”)^0.1”,
“details”: []
},
{
“value”: 2.2679522,
“description”: “product of:”,
“details”: [
{
“value”: 0.75598407,
“description”: “random score function (seed: 10, field: _seq_no)”,
“details”: []
},
{
“value”: 3.0,
“description”: “weight”,
“details”: []
}
]
}
]
},
{
“value”: 0.0,
“description”: “product of:”,
“details”: [
{
“value”: 0.0,
“description”: “Function for field gdLocation:”,
“details”: [
{
“value”: 0.0,
“description”: “exp(-0.5*pow(MIN of: [Math.max(arcDistance(23.118030996993184, 113.31892794929445(=doc value),113.324994, 23.150261(=origin)) - 1000.0(=offset), 0)],2.0)/1803975.3084153999)”,
“details”: []
}
]
},
{
“value”: 20.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 14.995842,
“description”: “product of:”,
“details”: [
{
“value”: 0.9997228,
“description”: “Function for field minPrice:”,
“details”: [
{
“value”: 0.9997228,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(149.0(=doc value) - 150.0(=origin))) - 0.0(=offset), 0)],2.0)/1803.3688011112042)”,
“details”: []
}
]
},
{
“value”: 15.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 9.845252,
“description”: “product of:”,
“details”: [
{
“value”: 0.9845252,
“description”: “Function for field commentPoint:”,
“details”: [
{
“value”: 0.9845252,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(3.700000047683716(=doc value) - 5.0(=origin))) - 1.0(=offset), 0)],2.0)/2.8853900817779268)”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “weight”,
“details”: []
}
]
}
]
},
{
“value”: 100.0,
“description”: “maxBoost”,
“details”: []
}
]
}
},
{
“_shard”: “[hotel_test][0]”,
“_node”: “cdYh0ptNTP6kMXlVSE8dqA”,
“_index”: “hotel_test”,
“_type”: “_doc”,
“_id”: “CCId1I0BqMZKQzdg3dtd”,
“_score”: 26.72167,
“_source”: {
“gdLocation”: {
“lon”: “113.319571”,
“lat”: “23.118040”
},
“address”: “珠江新城华穗路174”,
“cityName”: “广州市”,
“commentPoint”: 3.6,
“minPrice”: 157.0,
“hotelName”: “广州华美酒店公寓”
},
“fields”: {
“distance_in_m”: [
3625.479965509789
]
},
“_explanation”: {
“value”: 26.72167,
“description”: “min of:”,
“details”: [
{
“value”: 26.72167,
“description”: “function score, score mode [sum]”,
“details”: [
{
“value”: 2.1975284,
“description”: “function score, product of:”,
“details”: [
{
“value”: 1.0,
“description”: “match filter: (hotelName:“酒 店 公 寓”)^0.2 (hotelName:“青 年 旅 舍”)^0.1 (hotelName:or)^2.0 (hotelName:“青 年 公 寓”)^0.1”,
“details”: []
},
{
“value”: 2.1975284,
“description”: “product of:”,
“details”: [
{
“value”: 0.7325095,
“description”: “random score function (seed: 10, field: _seq_no)”,
“details”: []
},
{
“value”: 3.0,
“description”: “weight”,
“details”: []
}
]
}
]
},
{
“value”: 0.0,
“description”: “product of:”,
“details”: [
{
“value”: 0.0,
“description”: “Function for field gdLocation:”,
“details”: [
{
“value”: 0.0,
“description”: “exp(-0.5*pow(MIN of: [Math.max(arcDistance(23.118039965629578, 113.31957092508674(=doc value),113.324994, 23.150261(=origin)) - 1000.0(=offset), 0)],2.0)/1803975.3084153999)”,
“details”: []
}
]
},
{
“value”: 20.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 14.797592,
“description”: “product of:”,
“details”: [
{
“value”: 0.98650616,
“description”: “Function for field minPrice:”,
“details”: [
{
“value”: 0.98650616,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(157.0(=doc value) - 150.0(=origin))) - 0.0(=offset), 0)],2.0)/1803.3688011112042)”,
“details”: []
}
]
},
{
“value”: 15.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 9.726549,
“description”: “product of:”,
“details”: [
{
“value”: 0.97265494,
“description”: “Function for field commentPoint:”,
“details”: [
{
“value”: 0.97265494,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(3.5999999046325684(=doc value) - 5.0(=origin))) - 1.0(=offset), 0)],2.0)/2.8853900817779268)”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “weight”,
“details”: []
}
]
}
]
},
{
“value”: 100.0,
“description”: “maxBoost”,
“details”: []
}
]
}
},
{
“_shard”: “[hotel_test][0]”,
“_node”: “cdYh0ptNTP6kMXlVSE8dqA”,
“_index”: “hotel_test”,
“_type”: “_doc”,
“_id”: “liIX1I0BqMZKQzdgfYmJ”,
“_score”: 25.0,
“_source”: {
“gdLocation”: {
“lon”: “113.332040”,
“lat”: “23.136532”
},
“address”: “天河东路153号富海大厦首层”,
“cityName”: “广州市”,
“commentPoint”: 4.1,
“minPrice”: 150.0,
“hotelName”: “IU酒店(广州天河东体育中心地铁站店)”
},
“fields”: {
“distance_in_m”: [
1688.0487591581082
]
},
“_explanation”: {
“value”: 25.0,
“description”: “min of:”,
“details”: [
{
“value”: 25.0,
“description”: “function score, score mode [sum]”,
“details”: [
{
“value”: 0.0,
“description”: “product of:”,
“details”: [
{
“value”: 0.0,
“description”: “Function for field gdLocation:”,
“details”: [
{
“value”: 0.0,
“description”: “exp(-0.5*pow(MIN of: [Math.max(arcDistance(23.13653199467808, 113.33203992806375(=doc value),113.324994, 23.150261(=origin)) - 1000.0(=offset), 0)],2.0)/1803975.3084153999)”,
“details”: []
}
]
},
{
“value”: 20.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 15.0,
“description”: “product of:”,
“details”: [
{
“value”: 1.0,
“description”: “Function for field minPrice:”,
“details”: [
{
“value”: 1.0,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(150.0(=doc value) - 150.0(=origin))) - 0.0(=offset), 0)],2.0)/1803.3688011112042)”,
“details”: []
}
]
},
{
“value”: 15.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “product of:”,
“details”: [
{
“value”: 1.0,
“description”: “Function for field commentPoint:”,
“details”: [
{
“value”: 1.0,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(4.099999904632568(=doc value) - 5.0(=origin))) - 1.0(=offset), 0)],2.0)/2.8853900817779268)”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “weight”,
“details”: []
}
]
}
]
},
{
“value”: 100.0,
“description”: “maxBoost”,
“details”: []
}
]
}
},
{
“_shard”: “[hotel_test][0]”,
“_node”: “cdYh0ptNTP6kMXlVSE8dqA”,
“_index”: “hotel_test”,
“_type”: “_doc”,
“_id”: “JyIY1I0BqMZKQzdgnpWo”,
“_score”: 25.0,
“_source”: {
“gdLocation”: {
“lon”: “113.346694”,
“lat”: “23.173795”
},
“address”: “天源路134-140号201铺”,
“cityName”: “广州市”,
“commentPoint”: 4.2,
“minPrice”: 150.0,
“hotelName”: “广州友逸·青舍酒店(天河客运站地铁站店)”
},
“fields”: {
“distance_in_m”: [
3430.6572488915003
]
},
“_explanation”: {
“value”: 25.0,
“description”: “min of:”,
“details”: [
{
“value”: 25.0,
“description”: “function score, score mode [sum]”,
“details”: [
{
“value”: 0.0,
“description”: “product of:”,
“details”: [
{
“value”: 0.0,
“description”: “Function for field gdLocation:”,
“details”: [
{
“value”: 0.0,
“description”: “exp(-0.5*pow(MIN of: [Math.max(arcDistance(23.173794960603118, 113.34669392555952(=doc value),113.324994, 23.150261(=origin)) - 1000.0(=offset), 0)],2.0)/1803975.3084153999)”,
“details”: []
}
]
},
{
“value”: 20.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 15.0,
“description”: “product of:”,
“details”: [
{
“value”: 1.0,
“description”: “Function for field minPrice:”,
“details”: [
{
“value”: 1.0,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(150.0(=doc value) - 150.0(=origin))) - 0.0(=offset), 0)],2.0)/1803.3688011112042)”,
“details”: []
}
]
},
{
“value”: 15.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “product of:”,
“details”: [
{
“value”: 1.0,
“description”: “Function for field commentPoint:”,
“details”: [
{
“value”: 1.0,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(4.199999809265137(=doc value) - 5.0(=origin))) - 1.0(=offset), 0)],2.0)/2.8853900817779268)”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “weight”,
“details”: []
}
]
}
]
},
{
“value”: 100.0,
“description”: “maxBoost”,
“details”: []
}
]
}
},
{
“_shard”: “[hotel_test][0]”,
“_node”: “cdYh0ptNTP6kMXlVSE8dqA”,
“_index”: “hotel_test”,
“_type”: “_doc”,
“_id”: “YCIZ1I0BqMZKQzdgKJuj”,
“_score”: 25.0,
“_source”: {
“gdLocation”: {
“lon”: “113.333399”,
“lat”: “23.192820”
},
“address”: “沙太路283号天健装饰城N栋”,
“cityName”: “广州市”,
“commentPoint”: 4.2,
“minPrice”: 150.0,
“hotelName”: “广州OK好主题商务酒店(南方医科大学店)”
},
“fields”: {
“distance_in_m”: [
4809.715858252524
]
},
“_explanation”: {
“value”: 25.0,
“description”: “min of:”,
“details”: [
{
“value”: 25.0,
“description”: “function score, score mode [sum]”,
“details”: [
{
“value”: 0.0,
“description”: “product of:”,
“details”: [
{
“value”: 0.0,
“description”: “Function for field gdLocation:”,
“details”: [
{
“value”: 0.0,
“description”: “exp(-0.5*pow(MIN of: [Math.max(arcDistance(23.1928199948743, 113.33339896984398(=doc value),113.324994, 23.150261(=origin)) - 1000.0(=offset), 0)],2.0)/1803975.3084153999)”,
“details”: []
}
]
},
{
“value”: 20.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 15.0,
“description”: “product of:”,
“details”: [
{
“value”: 1.0,
“description”: “Function for field minPrice:”,
“details”: [
{
“value”: 1.0,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(150.0(=doc value) - 150.0(=origin))) - 0.0(=offset), 0)],2.0)/1803.3688011112042)”,
“details”: []
}
]
},
{
“value”: 15.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “product of:”,
“details”: [
{
“value”: 1.0,
“description”: “Function for field commentPoint:”,
“details”: [
{
“value”: 1.0,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(4.199999809265137(=doc value) - 5.0(=origin))) - 1.0(=offset), 0)],2.0)/2.8853900817779268)”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “weight”,
“details”: []
}
]
}
]
},
{
“value”: 100.0,
“description”: “maxBoost”,
“details”: []
}
]
}
},
{
“_shard”: “[hotel_test][0]”,
“_node”: “cdYh0ptNTP6kMXlVSE8dqA”,
“_index”: “hotel_test”,
“_type”: “_doc”,
“_id”: “LCIX1I0BqMZKQzdgP4dj”,
“_score”: 24.995842,
“_source”: {
“gdLocation”: {
“lon”: “113.347091”,
“lat”: “23.174963”
},
“address”: “天源路150号”,
“cityName”: “广州市”,
“commentPoint”: 4.1,
“minPrice”: 149.0,
“hotelName”: “广州源悦商务酒店(天河客运站店)”
},
“fields”: {
“distance_in_m”: [
3556.3638692192253
]
},
“_explanation”: {
“value”: 24.995842,
“description”: “min of:”,
“details”: [
{
“value”: 24.995842,
“description”: “function score, score mode [sum]”,
“details”: [
{
“value”: 0.0,
“description”: “product of:”,
“details”: [
{
“value”: 0.0,
“description”: “Function for field gdLocation:”,
“details”: [
{
“value”: 0.0,
“description”: “exp(-0.5*pow(MIN of: [Math.max(arcDistance(23.174962978810072, 113.34709097631276(=doc value),113.324994, 23.150261(=origin)) - 1000.0(=offset), 0)],2.0)/1803975.3084153999)”,
“details”: []
}
]
},
{
“value”: 20.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 14.995842,
“description”: “product of:”,
“details”: [
{
“value”: 0.9997228,
“description”: “Function for field minPrice:”,
“details”: [
{
“value”: 0.9997228,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(149.0(=doc value) - 150.0(=origin))) - 0.0(=offset), 0)],2.0)/1803.3688011112042)”,
“details”: []
}
]
},
{
“value”: 15.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “product of:”,
“details”: [
{
“value”: 1.0,
“description”: “Function for field commentPoint:”,
“details”: [
{
“value”: 1.0,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(4.099999904632568(=doc value) - 5.0(=origin))) - 1.0(=offset), 0)],2.0)/2.8853900817779268)”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “weight”,
“details”: []
}
]
}
]
},
{
“value”: 100.0,
“description”: “maxBoost”,
“details”: []
}
]
}
},
{
“_shard”: “[hotel_test][0]”,
“_node”: “cdYh0ptNTP6kMXlVSE8dqA”,
“_index”: “hotel_test”,
“_type”: “_doc”,
“_id”: “vCIY1I0BqMZKQzdgGY-9”,
“_score”: 24.995842,
“_source”: {
“gdLocation”: {
“lon”: “113.300959”,
“lat”: “23.143710”
},
“address”: “永福路3号”,
“cityName”: “广州市”,
“commentPoint”: 4.1,
“minPrice”: 151.0,
“hotelName”: “窝趣公寓(广州永福黄花岗地铁站店)”
},
“fields”: {
“distance_in_m”: [
2563.1222106598048
]
},
“_explanation”: {
“value”: 24.995842,
“description”: “min of:”,
“details”: [
{
“value”: 24.995842,
“description”: “function score, score mode [sum]”,
“details”: [
{
“value”: 0.0,
“description”: “product of:”,
“details”: [
{
“value”: 0.0,
“description”: “Function for field gdLocation:”,
“details”: [
{
“value”: 0.0,
“description”: “exp(-0.5*pow(MIN of: [Math.max(arcDistance(23.143709963187575, 113.30095899291337(=doc value),113.324994, 23.150261(=origin)) - 1000.0(=offset), 0)],2.0)/1803975.3084153999)”,
“details”: []
}
]
},
{
“value”: 20.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 14.995842,
“description”: “product of:”,
“details”: [
{
“value”: 0.9997228,
“description”: “Function for field minPrice:”,
“details”: [
{
“value”: 0.9997228,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(151.0(=doc value) - 150.0(=origin))) - 0.0(=offset), 0)],2.0)/1803.3688011112042)”,
“details”: []
}
]
},
{
“value”: 15.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “product of:”,
“details”: [
{
“value”: 1.0,
“description”: “Function for field commentPoint:”,
“details”: [
{
“value”: 1.0,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(4.099999904632568(=doc value) - 5.0(=origin))) - 1.0(=offset), 0)],2.0)/2.8853900817779268)”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “weight”,
“details”: []
}
]
}
]
},
{
“value”: 100.0,
“description”: “maxBoost”,
“details”: []
}
]
}
},
{
“_shard”: “[hotel_test][0]”,
“_node”: “cdYh0ptNTP6kMXlVSE8dqA”,
“_index”: “hotel_test”,
“_type”: “_doc”,
“_id”: “pCIX1I0BqMZKQzdgfYmJ”,
“_score”: 24.995842,
“_source”: {
“gdLocation”: {
“lon”: “113.280966”,
“lat”: “23.133804”
},
“address”: “建设大马路13号”,
“cityName”: “广州市”,
“commentPoint”: 4.3,
“minPrice”: 151.0,
“hotelName”: “7天优品酒店(广州建设大马路店)”
},
“fields”: {
“distance_in_m”: [
4859.477242418425
]
},
“_explanation”: {
“value”: 24.995842,
“description”: “min of:”,
“details”: [
{
“value”: 24.995842,
“description”: “function score, score mode [sum]”,
“details”: [
{
“value”: 0.0,
“description”: “product of:”,
“details”: [
{
“value”: 0.0,
“description”: “Function for field gdLocation:”,
“details”: [
{
“value”: 0.0,
“description”: “exp(-0.5*pow(MIN of: [Math.max(arcDistance(23.133803978562355, 113.28096597455442(=doc value),113.324994, 23.150261(=origin)) - 1000.0(=offset), 0)],2.0)/1803975.3084153999)”,
“details”: []
}
]
},
{
“value”: 20.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 14.995842,
“description”: “product of:”,
“details”: [
{
“value”: 0.9997228,
“description”: “Function for field minPrice:”,
“details”: [
{
“value”: 0.9997228,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(151.0(=doc value) - 150.0(=origin))) - 0.0(=offset), 0)],2.0)/1803.3688011112042)”,
“details”: []
}
]
},
{
“value”: 15.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “product of:”,
“details”: [
{
“value”: 1.0,
“description”: “Function for field commentPoint:”,
“details”: [
{
“value”: 1.0,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(4.300000190734863(=doc value) - 5.0(=origin))) - 1.0(=offset), 0)],2.0)/2.8853900817779268)”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “weight”,
“details”: []
}
]
}
]
},
{
“value”: 100.0,
“description”: “maxBoost”,
“details”: []
}
]
}
},
{
“_shard”: “[hotel_test][0]”,
“_node”: “cdYh0ptNTP6kMXlVSE8dqA”,
“_index”: “hotel_test”,
“_type”: “_doc”,
“_id”: “9iMk1I0BqMZKQzdgQzUI”,
“_score”: 24.983374,
“_source”: {
“gdLocation”: {
“lon”: “113.327053”,
“lat”: “23.192682”
},
“address”: “广州大道北同和镇蟹山村牌坊侧”,
“cityName”: “广州市”,
“commentPoint”: 4.4,
“minPrice”: 148.0,
“hotelName”: “城市便捷酒店(广州南方医院同和地铁站店)”
},
“fields”: {
“distance_in_m”: [
4721.698475981125
]
},
“_explanation”: {
“value”: 24.983374,
“description”: “min of:”,
“details”: [
{
“value”: 24.983374,
“description”: “function score, score mode [sum]”,
“details”: [
{
“value”: 0.0,
“description”: “product of:”,
“details”: [
{
“value”: 0.0,
“description”: “Function for field gdLocation:”,
“details”: [
{
“value”: 0.0,
“description”: “exp(-0.5*pow(MIN of: [Math.max(arcDistance(23.19268198683858, 113.32705294713378(=doc value),113.324994, 23.150261(=origin)) - 1000.0(=offset), 0)],2.0)/1803975.3084153999)”,
“details”: []
}
]
},
{
“value”: 20.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 14.983374,
“description”: “product of:”,
“details”: [
{
“value”: 0.9988916,
“description”: “Function for field minPrice:”,
“details”: [
{
“value”: 0.9988916,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(148.0(=doc value) - 150.0(=origin))) - 0.0(=offset), 0)],2.0)/1803.3688011112042)”,
“details”: []
}
]
},
{
“value”: 15.0,
“description”: “weight”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “product of:”,
“details”: [
{
“value”: 1.0,
“description”: “Function for field commentPoint:”,
“details”: [
{
“value”: 1.0,
“description”: “exp(-0.5*pow(MIN[Math.max(Math.abs(4.400000095367432(=doc value) - 5.0(=origin))) - 1.0(=offset), 0)],2.0)/2.8853900817779268)”,
“details”: []
}
]
},
{
“value”: 10.0,
“description”: “weight”,
“details”: []
}
]
}
]
},
{
“value”: 100.0,
“description”: “maxBoost”,
“details”: []
}
]
}
},
{
“_shard”: “[hotel_test][0]”,
“_node”: “cdYh0ptNTP6kMXlVSE8dqA”,
“_index”: “hotel_test”,

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip204888 (备注大数据)
img

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

                ]
                                    },
                                    {
                                        "value": 10.0,
                                        "description": "weight",
                                        "details": []
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "value": 100.0,
                        "description": "maxBoost",
                        "details": []
                    }
                ]
            }
        },
        {
            "\_shard": "[hotel\_test][0]",
            "\_node": "cdYh0ptNTP6kMXlVSE8dqA",
            "\_index": "hotel\_test",
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip204888 (备注大数据)
[外链图片转存中…(img-nY8QVokW-1713120917249)]

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/空白诗007/article/detail/973087
推荐阅读
相关标签
  

闽ICP备14008679号