|
7 months ago | |
---|---|---|
.. | ||
config.go | 1 year ago | |
config.toml | 1 year ago | |
go.mod | 1 year ago | |
go.sum | 1 year ago | |
go_test.go | 1 year ago | |
main.go | 7 months ago | |
readme.md | 1 year ago | |
tools.go | 1 year ago |
画像 数据处理开发
参数名 类型 说明
buyer string 采购单位
area string 省份
city string 城市
class string 领域行业:情报一级分类
business_type string 客户行业:政府机构、教育单位等(根据buyerclass)
lasttime int64 最后更新时间,项目中最大的lasttime
project_count int 项目数量
project_money float64 项目金额
-- class,对应 tag_topinformation 的值,目前只有物业一个,后面要添加四个领域标签,一共就是5个。 要依据每个标签,还有采购单位类型
2.1增量 通过pici每日获取一次项目增量,从项目增量中取出buyer进行画像表数据更新或新增
2.2存量 需求是采购单位搜索列表,所以单位范围是所有采购单位
{
"query": {
"bool": {
"must": [
{
"term": {
"buyer": "泸州市龙马潭区人民医院"
}
},
{
"term": {
"tag_topinformation": "情报_物业"
}
}
]
}
},
"size": 1,
"sort": [
{
"lasttime": {
"order": "desc"
}
}
],
"aggs": {
"total_price": {
"sum": {
"field": "sortprice"
}
}
}
}
请求结果:
{
"hits": {
"total": {
"value": 8461,
"relation": "eq"
},
"max_score": null,
"hits": []
},
"aggregations": {
"total_price": {
"value": 1604166340.91
}
}
}
其中hits.total 是项目总数;聚合出来的total_price 是项目金额; 这里size 设置1,根据lasttime 倒序排序,拿到的就是 lasttime 最大值的数据