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
a68a777f
Commit
a68a777f
authored
Sep 02, 2020
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
联想词同城的医院提前
parent
16cccee2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
auto_tips.py
search/utils/auto_tips.py
+7
-4
No files found.
search/utils/auto_tips.py
View file @
a68a777f
...
...
@@ -37,7 +37,7 @@ def get_suggest_tips(query, lat, lng, offset=0, size=50, device_id=None):
sub_index_name
=
"suggest-v1"
else
:
sub_index_name
=
"suggest"
sub_index_name
=
"suggest
-v1
"
have_read_tips_set
,
ret_list
,
result_dict
=
get_query_by_es
(
query
=
str
(
query
)
.
lower
(),
lat
=
lat
,
lng
=
lng
,
offset
=
offset
,
...
...
@@ -203,8 +203,10 @@ def get_query_by_es(query='', lat=0, lng=0, size=0, offset=0, highlight_query=No
get_tag_wiki_data
=
list
()
ret_list
=
list
()
doctor_hospital_equal_query
=
list
()
get_hospital_data_gt_50
=
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
(
"超声刀"
,
"超声提升"
)
...
...
@@ -236,12 +238,12 @@ def get_query_by_es(query='', lat=0, lng=0, size=0, offset=0, highlight_query=No
hit_item
[
"_source"
][
"describe"
]
=
">50km"
else
:
hit_item
[
"_source"
][
"describe"
]
=
""
else
:
hit_item
[
"_source"
][
"describe"
]
=
""
if
hit_item
[
"_source"
][
"ori_name"
]
==
query
:
doctor_hospital_equal_query
.
append
(
hit_item
[
"_source"
])
elif
hit_item
[
"_source"
][
"describe"
]
==
">50km"
:
get_hospital_data_gt_50
.
append
(
hit_item
[
"_source"
])
else
:
get_doctor_hospital_data
.
append
(
hit_item
[
"_source"
])
...
...
@@ -267,6 +269,7 @@ def get_query_by_es(query='', lat=0, lng=0, size=0, offset=0, highlight_query=No
ret_list
.
extend
(
doctor_hospital_equal_query
)
ret_list
.
extend
(
get_tag_wiki_data
)
ret_list
.
extend
(
get_doctor_hospital_data
)
ret_list
.
extend
(
get_hospital_data_gt_50
)
return
have_read_tips_set
,
ret_list
,
result_dict
except
:
...
...
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