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
e8d5e9b8
Commit
e8d5e9b8
authored
Mar 05, 2020
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
is_online
parent
cdbf5809
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
words_utils.py
trans2es/commons/words_utils.py
+0
-1
search_query.py
trans2es/utils/search_query.py
+3
-3
No files found.
trans2es/commons/words_utils.py
View file @
e8d5e9b8
...
...
@@ -195,7 +195,6 @@ class QueryWordAttr(object):
@classmethod
def
save_query_to_redis
(
cls
,
query
,
type_v1
=
False
):
try
:
return
True
lower_query
=
str
(
query
)
.
lower
()
key
=
"save_sub_query_to_redis"
if
type_v1
:
...
...
trans2es/utils/search_query.py
View file @
e8d5e9b8
...
...
@@ -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