Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
15d78c15
Commit
15d78c15
authored
Apr 29, 2020
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
ec91c0cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
209 additions
and
3 deletions
+209
-3
ai_test.py
ai_test.py
+13
-3
doctor.json
doctor.json
+96
-0
sort_key.py
sort_key.py
+100
-0
No files found.
ai_test.py
View file @
15d78c15
...
...
@@ -2,13 +2,23 @@
import
json
import
requests
# url="http://127.0.0.1:4050/v1/once"
url
=
"http://doris.paas.test/v1/once"
url
=
"http://doris.paas-test.env/v1/once"
# 如果在生产环境doris 01上执行,把url改成"http://127.0.0.1:4050/v1/once"
header_dict
=
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
param_dict
=
{}
param_dict
[
"method"
]
=
"doris/search/bangdan"
param_detail
=
{
"device_id"
:
"1"
,
"size"
:
20
,
"user_city_tag_id"
:
328
,
"offset"
:
0
,
"is_officer"
:
False
,
"unit_ids"
:[]}
param_dict
[
"method"
]
=
"doris/search/spu_sku"
param_detail
=
{
"device_id"
:
"3ab"
,
"size"
:
10
,
"offset"
:
0
,
"user_city_tag_id"
:
328
,
"recall_type"
:
2
,
"unit_id"
:
4
,
"sort_params"
:{
"lat"
:
0
,
"lng"
:
0
},
"tag_ids"
:[
993
,
971
,
5
,
41
,
759
,
47
,
821
],
"filters"
:{
"tag_ids"
:[
971
]}}
# 美购首页活动美购
# param_dict["method"]="doris/search/activity"
# param_detail = {"device_id":"hello","promotion_id":342,"user_city_tag_id":328,"size":10}
# param_dict["method"]="doris/search/doctor_officer"
# param_detail = {"device_id":"hello","size":10,"user_city_tag_id":328,"offset":0,"is_officer":False,
# "filters":{},"query":"连喜艳"}
param_dict
[
"params"
]
=
json
.
dumps
(
param_detail
)
...
...
doctor.json
0 → 100644
View file @
15d78c15
{
"dynamic"
:
"strict"
,
"properties"
:
{
"id"
:{
"type"
:
"string"
,
"index"
:
"not_analyzed"
},
"name"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_ngram_index"
,
"search_analyzer"
:
"gm_default_search"
},
"name_highlight"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_default_index"
,
"search_analyzer"
:
"gm_default_search"
},
//用来高亮显示
"name_raw"
:{
"type"
:
"string"
,
"index"
:
"not_analyzed"
},
//医生名字(未分词)用于精确匹配
"is_online"
:{
"type"
:
"boolean"
},
"doctor_type"
:{
"type"
:
"string"
,
"index"
:
"not_analyzed"
},
//医生类型
"is_authenticated"
:{
"type"
:
"boolean"
},
//是否认证(绑定手机号)
"accept_private_msg"
:{
"type"
:
"boolean"
},
//是否接受私信
"famous_doctor"
:{
"type"
:
"boolean"
,
"null_value"
:
false
},
//是否名医
"ticket_sink_start_time"
:{
//罚单下沉起始时间
"type"
:
"date"
,
"format"
:
"date_time_no_millis"
},
"ticket_sink_end_time"
:{
//罚单下沉终止时间
"type"
:
"date"
,
"format"
:
"date_time_no_millis"
},
//
机构罚单
"org_sink_start_time"
:{
"type"
:
"date"
,
"format"
:
"date_time_no_millis"
},
//开始时间
"org_sink_end_time"
:{
"type"
:
"date"
,
"format"
:
"date_time_no_millis"
},
//结束时间
"hospital"
:{
"type"
:
"object"
,
"properties"
:{
"id"
:{
"type"
:
"string"
,
"index"
:
"not_analyzed"
},
"name"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_ngram_index"
,
"search_analyzer"
:
"gm_default_search"
},
//医院名
"name_highlight"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_default_index"
,
"search_analyzer"
:
"gm_default_search"
},
//用来高亮显示
"officer_name"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_default_index"
,
"search_analyzer"
:
"gm_default_search"
},
//机构管理者名称
"hospital_type"
:{
"type"
:
"string"
,
"index"
:
"not_analyzed"
},
//医院类型
,
0
公立
,
1
民营
"city_name"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_ngram_index"
,
"search_analyzer"
:
"gm_default_search"
},
//城市名
"city_tag_id"
:{
"type"
:
"long"
},
//城市tag
id
"city_province_name"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_ngram_index"
,
"search_analyzer"
:
"gm_default_search"
},
//省份名
"city_province_tag_id"
:{
"type"
:
"long"
},
//省份tag
id
"city_province_country_tag_id"
:{
"type"
:
"long"
},
//国家tagID
"doctor_names"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_ngram_index"
,
"search_analyzer"
:
"gm_default_search"
}
//医院下所有医生名
}
},
"problems"
:{
"type"
:
"nested"
,
"properties"
:{
"id"
:{
"type"
:
"long"
},
"tags"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_default_index"
,
"search_analyzer"
:
"gm_default_search"
}
}
},
"services"
:{
//直接关联的services
"type"
:
"nested"
,
"properties"
:{
"id"
:{
"type"
:
"long"
},
"name"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_ngram_index"
,
"search_analyzer"
:
"gm_default_search"
,
"omit_norms"
:
true
},
//名字
"short_description"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_ngram_index"
,
"search_analyzer"
:
"gm_default_search"
,
"omit_norms"
:
true
},
//一句话描述
"short_description_highlight"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_default_index"
,
"search_analyzer"
:
"gm_default_search"
,
"omit_norms"
:
true
},
//用来高亮显示
"all_text"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_ngram_index"
,
"search_analyzer"
:
"gm_default_search"
},
//
把美购名称、描述、closure_tags、sku名称拼接到这个字段,方便搜索
"is_can_be_sold"
:{
"type"
:
"boolean"
},
//
[
DEPRECATED
]
是否在售
"doctor_score"
:{
"type"
:
"double"
},
//
该美购所属的医生整体得分*
70
%+品类得分*
30
%+CPC
"doctor_score_v1"
:{
"type"
:
"double"
},
//
该美购所属的医生整体得分*
70
%+品类得分*
30
%
"start_time"
:{
"type"
:
"date"
,
"format"
:
"date_time_no_millis"
},
//开始时间
"end_time"
:{
"type"
:
"date"
,
"format"
:
"date_time_no_millis"
},
//结束时间
"special_ids"
:{
"type"
:
"long"
,
"index"
:
"not_analyzed"
}
//属于哪些专题
}
},
"doctor_score"
:
{
"type"
:
"double"
},
//
医生或医院的综合分:ctr开根号*(单pv佣金贡献+单pv广告消耗)
"cpc_doctor_score"
:
{
"type"
:
"double"
},
//
doctor_score映射成
0
到
100
,然后加上cpc
"is_cpc"
:{
"type"
:
"boolean"
},
"is_sink"
:{
"type"
:
"boolean"
},
"closure_tag_ids"
:{
"type"
:
"long"
},
//tag
id闭包
"service_closure_tag_ids"
:{
"type"
:
"long"
},
//对于医生
是所有关联美购的tag
对于机构管理者
是所关联医院下的所有医生的所有关联美购的tag
"service_closure_tags"
:{
"type"
:
"string"
,
"analyzer"
:
"gm_ngram_index"
,
"search_analyzer"
:
"gm_default_search"
,
"index_options"
:
"offsets"
},
"advertise_position"
:{
"type"
:
"string"
,
"index"
:
"not_analyzed"
},
//广告位置
用于加速过滤
"advertise_searchwords"
:{
"type"
:
"string"
,
"index"
:
"not_analyzed"
},
//所有搜索词
用于加速过滤
"advertise_tag_ids"
:{
"type"
:
"long"
},
//广告过滤tagID
"advertise_info"
:{
//广告具体信息
"type"
:
"object"
,
"enabled"
:
false
,
"properties"
:{
"id"
:{
"type"
:
"long"
},
//ID
"position"
:{
"type"
:
"string"
,
"index"
:
"not_analyzed"
},
//list
of
位置
"start_time_epoch"
:{
"type"
:
"long"
},
//开始时间
"end_time_epoch"
:{
"type"
:
"long"
},
//结束时间
"searchwords"
:{
"type"
:
"string"
,
"index"
:
"not_analyzed"
},
//搜索词(如果有)
"ordering"
:{
"type"
:
"long"
}
}
},
"last_30d_payment"
:{
"type"
:
"double"
},
"last_30d_ad_money"
:{
"type"
:
"double"
},
"ctr"
:{
"type"
:
"double"
},
//
CTR指数
"xiadan_index"
:{
"type"
:
"double"
},
//
下单指数
"last_30d_uv"
:{
"type"
:
"double"
},
"rank_score"
:
{
"type"
:
"double"
},
"nearby_city_tag_ids"
:
{
"type"
:
"double"
},
"merchant_id"
:
{
"type"
:
"string"
,
"index"
:
"not_analyzed"
},
"merchant_level"
:{
"type"
:
"long"
},
"user_id"
:{
"type"
:
"long"
}
//用户ID
}
}
sort_key.py
0 → 100644
View file @
15d78c15
import
redis
import
json
tag_key
=
"icon_city_sort"
tag_value
=
dict
()
T1
=
[
328
,
592
,
409
]
T2
=
[
604
,
352
,
675
,
662
,
343
,
542
,
425
,
359
,
744
,
493
]
T3
=
[
430
,
538
,
603
,
376
,
623
,
670
,
550
,
660
,
400
,
674
,
606
,
395
,
382
,
543
,
572
,
468
,
638
,
412
]
tag_value
[
"t1_city"
]
=
T1
tag_value
[
"t2_city"
]
=
T2
tag_value
[
"t3_city"
]
=
T3
boniaosuan
=
[
97
,
99
,
115
,
121
,
123
,
137
,
141
,
152
,
197
,
200
,
203
,
243
,
776
,
777
,
804
,
868
,
885
,
954
,
1055
,
6148
]
chuzhoushoulian
=
[
79
,
117
,
168
,
205
,
207
,
237
,
798
,
842
,
1801
,
2033
,
5077
,
6148
]
bibu
=
[
2929
,
9123
,
8627
,
2925
,
2924
,
2927
,
2926
,
115
,
114
,
116
,
111
,
110
,
8464
,
112
,
234
,
253
,
7977
,
9027
,
232
,
233
,
797
,
796
,
26
,
21
,
22
,
23
,
106
,
7151
,
798
,
9069
,
2
,
810
,
24
,
9063
,
896
,
897
,
8394
,
8773
,
2073
,
108
,
109
,
3285
,
9047
,
107
,
105
,
965
,
966
,
3038
,
782
,
7993
,
803
,
804
,
806
,
805
,
65
]
yanbu
=
[
2923
,
91
,
88
,
89
,
64
,
9012
,
9050
,
6163
,
5057
,
86
,
87
,
85
,
975
,
8865
,
780
,
878
,
790
,
953
,
3459
,
1
,
92
,
890
,
2429
,
777
,
102
,
90
,
101
,
95
,
3050
,
964
,
6138
,
15
,
17
,
19
,
18
,
3037
,
940
,
2417
]
mianbulunkuo
=
[
766
,
7823
,
130
,
3001
,
6146
,
235
,
81
,
5060
,
46
,
45
,
28
,
29
,
819
,
3
,
812
,
813
,
815
,
817
,
142
,
143
,
898
,
899
,
2932
,
1136
,
122
,
124
,
126
,
127
,
128
,
129
,
869
,
900
,
967
,
30
,
968
,
969
]
zhifangtianchong
=
[
153
,
198
,
114
,
7117
,
136
,
135
,
886
,
793
,
875
,
933
,
201
,
204
,
140
,
1233
,
120
,
98
,
241
,
125
,
102
,
225
,
1024
,
244
,
805
]
meitishoushen
=
[
213
,
982
,
986
,
985
,
131
,
8681
,
238
,
239
,
252
,
236
,
237
,
230
,
118
,
836
,
837
,
8989
,
4
,
811
,
1017
,
911
,
774
,
9048
,
240
,
229
,
224
,
223
,
221
,
38
,
906
,
842
,
841
,
840
,
909
]
kouqiangchike
=
[
2459
,
154
,
157
,
156
,
2455
,
2454
,
2456
,
2451
,
2450
,
2453
,
155
,
5070
,
255
,
854
,
856
,
851
,
852
,
159
,
158
,
917
,
761
,
2460
,
7809
,
7129
,
11
,
861
,
860
,
57
,
53
]
kangshuaijinzhi
=
[
199
,
198
,
2866
,
197
,
196
,
5073
,
6163
,
6148
,
872
,
873
,
5
,
933
,
931
,
930
,
201
,
200
,
203
,
202
,
205
,
204
,
207
,
206
,
244
,
246
,
243
,
8000
,
79
,
787
,
3039
,
1801
,
928
,
2352
,
824
,
922
,
2063
,
926
,
822
]
yixuemeifu
=
[
5065
,
199
,
2866
,
196
,
192
,
3049
,
258
,
1387
,
6147
,
6943
,
2942
,
2941
,
835
,
2059
,
47
,
1966
,
2939
,
872
,
41
,
919
,
187
,
186
,
5
,
930
,
7554
,
775
,
5067
,
202
,
2938
,
206
,
2936
,
2937
,
2935
,
5068
,
242
,
246
,
2072
,
1992
,
1703
,
35
,
928
,
2108
,
829
,
825
,
824
,
827
,
912
,
822
]
simi
=
[
217
,
768
,
767
,
218
,
7175
,
7177
,
7176
,
67
,
2946
,
7179
,
7178
,
959
,
7091
,
955
,
6684
,
4282
,
165
,
166
,
167
,
161
,
162
,
163
,
10
,
960
,
4870
]
zhifatuomao
=
[
865
,
2054
,
983
,
8059
,
37
,
36
,
2947
,
181
,
2663
,
9
,
175
,
251
,
6338
,
80
,
171
,
8548
]
xiaba
=
[
784
,
46
,
130
,
819
,
131
,
123
,
124
,
125
,
126
,
127
,
128
,
129
,
252
]
chunbu
=
[
903
,
12
,
907
,
904
,
150
,
1204
,
863
,
864
,
2497
,
149
,
181
,
134
,
52
,
31
,
816
]
shibaixiufu
=
[
964
,
965
,
967
,
210
,
878
,
2429
,
968
,
969
,
971
,
64
,
65
,
70
,
82
,
869
,
81
,
2950
,
2951
]
banyongjiu
=
[
2954
,
1370
,
1114
,
2054
,
1080
]
xiongbu
=
[
7
,
66
,
69
,
70
,
210
,
212
,
220
,
241
,
785
,
870
,
871
,
954
,
2354
,
5724
,
6144
,
6145
,
8710
]
rule
=
{
"t1_"
+
str
(
sorted
(
boniaosuan
)):
1
,
"t2_"
+
str
(
sorted
(
boniaosuan
)):
1
,
"t3_"
+
str
(
sorted
(
boniaosuan
)):
2
,
"t4_"
+
str
(
sorted
(
boniaosuan
)):
3
,
"t1_"
+
str
(
sorted
(
chuzhoushoulian
)):
1
,
"t2_"
+
str
(
sorted
(
chuzhoushoulian
)):
1
,
"t3_"
+
str
(
sorted
(
chuzhoushoulian
)):
2
,
"t4_"
+
str
(
sorted
(
chuzhoushoulian
)):
3
,
"t1_"
+
str
(
sorted
(
bibu
)):
1
,
"t2_"
+
str
(
sorted
(
bibu
)):
2
,
"t3_"
+
str
(
sorted
(
bibu
)):
3
,
"t4_"
+
str
(
sorted
(
bibu
)):
3
,
"t1_"
+
str
(
sorted
(
yanbu
)):
1
,
"t2_"
+
str
(
sorted
(
yanbu
)):
2
,
"t3_"
+
str
(
sorted
(
yanbu
)):
3
,
"t4_"
+
str
(
sorted
(
yanbu
)):
3
,
"t1_"
+
str
(
sorted
(
mianbulunkuo
)):
1
,
"t2_"
+
str
(
sorted
(
mianbulunkuo
)):
2
,
"t3_"
+
str
(
sorted
(
mianbulunkuo
)):
3
,
"t4_"
+
str
(
sorted
(
mianbulunkuo
)):
3
,
"t1_"
+
str
(
sorted
(
zhifangtianchong
)):
1
,
"t2_"
+
str
(
sorted
(
zhifangtianchong
)):
2
,
"t3_"
+
str
(
sorted
(
zhifangtianchong
)):
3
,
"t4_"
+
str
(
sorted
(
zhifangtianchong
)):
3
,
"t1_"
+
str
(
sorted
(
meitishoushen
)):
1
,
"t2_"
+
str
(
sorted
(
meitishoushen
)):
2
,
"t3_"
+
str
(
sorted
(
meitishoushen
)):
3
,
"t4_"
+
str
(
sorted
(
meitishoushen
)):
3
,
"t1_"
+
str
(
sorted
(
kouqiangchike
)):
1
,
"t2_"
+
str
(
sorted
(
kouqiangchike
)):
1
,
"t3_"
+
str
(
sorted
(
kouqiangchike
)):
2
,
"t4_"
+
str
(
sorted
(
kouqiangchike
)):
2
,
"t1_"
+
str
(
sorted
(
kangshuaijinzhi
)):
1
,
"t2_"
+
str
(
sorted
(
kangshuaijinzhi
)):
2
,
"t3_"
+
str
(
sorted
(
kangshuaijinzhi
)):
3
,
"t4_"
+
str
(
sorted
(
kangshuaijinzhi
)):
3
,
"t1_"
+
str
(
sorted
(
yixuemeifu
)):
1
,
"t2_"
+
str
(
sorted
(
yixuemeifu
)):
1
,
"t3_"
+
str
(
sorted
(
yixuemeifu
)):
2
,
"t4_"
+
str
(
sorted
(
yixuemeifu
)):
2
,
"t1_"
+
str
(
sorted
(
simi
)):
1
,
"t2_"
+
str
(
sorted
(
simi
)):
1
,
"t3_"
+
str
(
sorted
(
simi
)):
2
,
"t4_"
+
str
(
sorted
(
simi
)):
3
,
"t1_"
+
str
(
sorted
(
zhifatuomao
)):
1
,
"t2_"
+
str
(
sorted
(
zhifatuomao
)):
2
,
"t3_"
+
str
(
sorted
(
zhifatuomao
)):
3
,
"t4_"
+
str
(
sorted
(
zhifatuomao
)):
3
,
"t1_"
+
str
(
sorted
(
xiaba
)):
1
,
"t2_"
+
str
(
sorted
(
xiaba
)):
2
,
"t3_"
+
str
(
sorted
(
xiaba
)):
3
,
"t4_"
+
str
(
sorted
(
xiaba
)):
3
,
"t1_"
+
str
(
sorted
(
shibaixiufu
)):
1
,
"t2_"
+
str
(
sorted
(
shibaixiufu
)):
2
,
"t3_"
+
str
(
sorted
(
shibaixiufu
)):
4
,
"t4_"
+
str
(
sorted
(
shibaixiufu
)):
5
,
"t1_"
+
str
(
sorted
(
banyongjiu
)):
1
,
"t2_"
+
str
(
sorted
(
banyongjiu
)):
1
,
"t3_"
+
str
(
sorted
(
banyongjiu
)):
2
,
"t4_"
+
str
(
sorted
(
banyongjiu
)):
3
,
"t1_"
+
str
(
sorted
(
xiongbu
)):
1
,
"t2_"
+
str
(
sorted
(
xiongbu
)):
2
,
"t3_"
+
str
(
sorted
(
xiongbu
)):
3
,
"t4_"
+
str
(
sorted
(
xiongbu
)):
3
}
tag_value
[
"sort_rule"
]
=
rule
r
=
redis
.
StrictRedis
.
from_url
(
'redis://:ReDis!GmTx*0aN6@172.16.40.133:6379'
)
r
.
hmset
(
"name"
,
aa
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment