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
20390b32
Commit
20390b32
authored
Aug 27, 2019
by
李小芳
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wordres' into 'master'
add See merge request
!33
parents
e7c25ac5
73a98c6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
6 deletions
+0
-6
auto_tips.py
search/utils/auto_tips.py
+0
-6
No files found.
search/utils/auto_tips.py
View file @
20390b32
...
...
@@ -117,7 +117,6 @@ def get_suggest_tips(query, lat, lng, offset=0, size=50):
result_dict
=
ESPerform
.
get_search_results
(
ESPerform
.
get_cli
(),
sub_index_name
=
"suggest"
,
query_body
=
q
,
offset
=
offset
,
size
=
size
,
is_suggest_request
=
True
)
logging
.
info
(
"get result_dict:
%
s"
%
result_dict
)
for
tips_item
in
result_dict
[
"suggest"
][
"tips-suggest"
]:
for
hit_item
in
tips_item
[
"options"
]:
...
...
@@ -163,7 +162,6 @@ def get_suggest_tips(query, lat, lng, offset=0, size=50):
ret_list
.
extend
(
get_tag_wiki_data
)
ret_list
.
extend
(
get_doctor_hospital_data
)
logging
.
info
(
"get have_read_tips_set:
%
s"
%
have_read_tips_set
)
if
len
(
result_dict
[
"suggest"
][
"tips-suggest"
])
>=
50
:
return
ret_list
...
...
@@ -174,9 +172,7 @@ def get_suggest_tips(query, lat, lng, offset=0, size=50):
QUERY_KEY
=
"query:search_tip"
query_base64
=
base64
.
b64encode
(
query
.
encode
(
'utf8'
))
.
decode
(
'utf8'
)
if
redis_client
.
hget
(
QUERY_KEY
,
query_base64
)
is
not
None
:
logging
.
info
(
"get type:
%
s"
%
type
(
redis_client
.
hget
(
QUERY_KEY
,
query_base64
)))
value_data
=
json
.
loads
(
str
(
redis_client
.
hget
(
QUERY_KEY
,
query_base64
),
encoding
=
'utf-8'
))
logging
.
info
(
"get value_data:
%
s"
%
value_data
)
if
len
(
value_data
)
>
0
:
for
i
in
value_data
:
...
...
@@ -201,8 +197,6 @@ def get_suggest_tips(query, lat, lng, offset=0, size=50):
"offline_score"
:
0
,
"type_flag"
:
get_tips_word_type
(
ori_name
),
"highlight_name"
:
highlight_name
,
"describe"
:
describe
})
logging
.
info
(
"get query_ret_list:
%
s"
%
query_ret_list
)
logging
.
info
(
"get wordresemble_ret_list:
%
s"
%
wordresemble_ret_list
)
ret_list
.
extend
(
query_ret_list
)
ret_list
.
extend
(
wordresemble_ret_list
)
if
len
(
ret_list
)
>=
50
:
...
...
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