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
68bd34c0
Commit
68bd34c0
authored
Mar 06, 2020
by
李小芳
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'resert' into 'master'
Resert See merge request
!62
parents
a5ca6a0c
8b1028a6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
search_query.py
trans2es/utils/search_query.py
+3
-3
No files found.
trans2es/utils/search_query.py
View file @
68bd34c0
...
...
@@ -27,7 +27,7 @@ class SearchWord(object):
is_online
=
False
if
instance
.
is_delete
else
True
else
:
is_online
=
False
item_dict
[
"is_online"
]
=
is_onlin
e
item_dict
[
"is_online"
]
=
False
if
instance
.
is_delete
else
Tru
e
item_dict
[
"order_weight"
]
=
QueryWordAttr
.
get_hot_search_query_word_weight
(
keyword
)
item_dict
[
"results_num"
]
=
QueryWordAttr
.
get_search_query_results_num
(
keyword
)
item_dict
[
"type_flag"
]
=
get_tips_word_type
(
keyword
)
...
...
@@ -50,7 +50,7 @@ class SearchWord(object):
suggest_list
=
list
()
sub_query
=
re
.
sub
(
'
\
W+'
,
''
,
instance
.
keyword
)
keyword
=
str
(
sub_query
)
.
lower
()
ret_bol
=
QueryWordAttr
.
save_query_to_redis
(
query
=
sub_query
,
type_v1
=
True
)
ret_bol
=
QueryWordAttr
.
save_query_to_redis
(
query
=
sub_query
,
type_v1
=
True
)
if
ret_bol
:
item_dict
[
"id"
]
=
getMd5Digest
(
keyword
)
item_dict
[
"ori_name"
]
=
keyword
...
...
@@ -58,7 +58,7 @@ class SearchWord(object):
is_online
=
False
if
instance
.
is_delete
else
True
else
:
is_online
=
False
item_dict
[
"is_online"
]
=
is_onlin
e
item_dict
[
"is_online"
]
=
False
if
instance
.
is_delete
else
Tru
e
item_dict
[
"order_weight"
]
=
QueryWordAttr
.
get_hot_search_query_word_weight
(
keyword
)
item_dict
[
"results_num"
]
=
QueryWordAttr
.
get_search_query_results_num
(
keyword
)
item_dict
[
"type_flag"
]
=
get_tips_word_type
(
keyword
)
...
...
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