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
7a6e1e35
Commit
7a6e1e35
authored
Dec 25, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完全匹配放前边
parent
888092c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
auto_tips.py
search/utils/auto_tips.py
+17
-3
No files found.
search/utils/auto_tips.py
View file @
7a6e1e35
...
...
@@ -114,6 +114,8 @@ def get_suggest_tips(query, lat, lng, offset=0, size=50):
get_tag_wiki_data
=
list
()
have_read_tips_set
=
set
()
ret_list
=
list
()
doctor_hospital_equal_query
=
list
()
tag_equal_query
=
list
()
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(),
sub_index_name
=
"suggest"
,
query_body
=
q
,
offset
=
offset
,
size
=
size
,
is_suggest_request
=
True
)
...
...
@@ -148,17 +150,29 @@ def get_suggest_tips(query, lat, lng, offset=0, size=50):
else
:
hit_item
[
"_source"
][
"describe"
]
=
""
get_doctor_hospital_data
.
append
(
hit_item
[
"_source"
])
if
hit_item
[
"_source"
][
"ori_name"
]
==
query
:
doctor_hospital_equal_query
.
append
(
hit_item
[
"_source"
])
else
:
get_doctor_hospital_data
.
append
(
hit_item
[
"_source"
])
else
:
if
hit_item
[
"_source"
][
"type_flag"
]
==
"doctor"
:
hit_item
[
"_source"
][
"describe"
]
=
""
get_doctor_hospital_data
.
append
(
hit_item
[
"_source"
])
if
hit_item
[
"_source"
][
"ori_name"
]
==
query
:
doctor_hospital_equal_query
.
append
(
hit_item
[
"_source"
])
else
:
get_doctor_hospital_data
.
append
(
hit_item
[
"_source"
])
else
:
hit_item
[
"_source"
][
"describe"
]
=
"约"
+
str
(
hit_item
[
"_source"
][
"results_num"
])
+
"个结果"
if
\
hit_item
[
"_source"
][
"results_num"
]
else
""
get_tag_wiki_data
.
append
(
hit_item
[
"_source"
])
if
hit_item
[
"_source"
][
"ori_name"
]
==
query
:
tag_equal_query
.
append
(
hit_item
[
"_source"
])
else
:
get_tag_wiki_data
.
append
(
hit_item
[
"_source"
])
ret_list
.
extend
(
tag_equal_query
)
ret_list
.
extend
(
doctor_hospital_equal_query
)
ret_list
.
extend
(
get_tag_wiki_data
)
ret_list
.
extend
(
get_doctor_hospital_data
)
...
...
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