Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
search_tips
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
search_tips
Commits
fb407d15
Commit
fb407d15
authored
Sep 10, 2020
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
13179ecf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
17 deletions
+9
-17
auto_tips.py
search/utils/auto_tips.py
+3
-15
commons.py
trans2es/commons/commons.py
+6
-2
No files found.
search/utils/auto_tips.py
View file @
fb407d15
...
...
@@ -16,26 +16,13 @@ from pypinyin import pinyin, lazy_pinyin
def
get_suggest_tips
(
query
,
lat
,
lng
,
offset
=
0
,
size
=
50
,
device_id
=
None
):
"""
这个地方目前是有三个逻辑 分两个灰度验证
50
%
前段强加权后根据tab转化率和词频进行排序 索引 suggest gray_number=1 尾号["0", "1", "2", "3", "c", "d", "e", "f"]
25
%
去掉前段强加权后 直接根据tag转化率和词频进行排序 suggest-v1 gray_number=2 尾号["4", "5", "6", "a"]
25
%
去掉前段强加权后 根据tag转化率和词频进行排序 再根据前段加权展示排序 suggest-v1 gray_number=3 尾号["9", "8", "7", "b"]
:param query:
:param lat:
:param lng:
:param offset:
:param size:
:param device_id:
:return:
"""
""" """
try
:
gray_number
=
1
###在原来的逻辑上加两层灰度
if
device_id
in
[
"057F28DF-20B8-488F-A285-931367FCC110"
]:
sub_index_name
=
"suggest-v1"
else
:
sub_index_name
=
"suggest"
...
...
@@ -204,7 +191,8 @@ def get_query_by_es(query='', lat=0, lng=0, size=0, offset=0, highlight_query=No
ret_list
=
list
()
doctor_hospital_equal_query
=
list
()
tag_equal_query
=
list
()
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(),
sub_index_name
=
sub_index_name
,
query_body
=
q
,
offset
=
offset
,
size
=
size
,
is_suggest_request
=
True
)
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(),
sub_index_name
=
sub_index_name
,
query_body
=
q
,
offset
=
offset
,
size
=
size
,
is_suggest_request
=
True
)
for
tips_item
in
result_dict
[
"suggest"
][
"tips-suggest"
]:
for
hit_item
in
tips_item
[
"options"
]:
hit_item
[
"_source"
][
"ori_name"
]
=
hit_item
[
"_source"
][
"ori_name"
]
.
replace
(
"超声刀"
,
"超声提升"
)
...
...
trans2es/commons/commons.py
View file @
fb407d15
...
...
@@ -118,8 +118,12 @@ def get_tips_suggest_list(instance_cn_name):
def
get_tips_suggest_list_v1
(
instance_cn_name
):
try
:
# ch_full_weight = 6.0 * 1000
# py_full_weight = 3.0 * 1000
ch_full_weight
=
6.0
*
1000
py_full_weight
=
3.0
*
1000
if
instance_cn_name
in
[
"AI测颜值"
,
"AI测肤质"
,
"ai测颜值"
,
"ai测肤质"
]:
full_weight
=
10000000
py_acronym_full_weight
=
1
else
:
full_weight
=
1
py_acronym_full_weight
=
1
...
...
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