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
2ccc7057
Commit
2ccc7057
authored
Jul 29, 2020
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改key
parent
c981f3ca
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
20 deletions
+16
-20
app_conf.xml
app_conf.xml
+2
-1
log_settings.py
search_tips/log_settings.py
+2
-1
log_settings.py_bak
search_tips/log_settings.py_bak
+2
-1
words_utils.py
trans2es/commons/words_utils.py
+10
-17
No files found.
app_conf.xml
View file @
2ccc7057
<?xml version="1.0" encoding="utf-8"?>
<gm_rpcd_config>
<info
config_name=
"app"
version=
"1.0"
/>
<config
name=
"log_dir"
value=
"/data/log/search_tips/app"
/>
<!-- <config name="log_dir" value="/data/log/search_tips/app"/>-->
<config
name=
"log_dir"
value=
"/Users/edz/Desktop/project/log/search_tips"
/>
<config
name=
"application_name"
value=
"search_tips"
/>
<config
name=
"service_list"
>
<element
value=
"search_tips"
/>
...
...
search_tips/log_settings.py
View file @
2ccc7057
...
...
@@ -5,7 +5,8 @@
import
os
import
logging
LOG_DIR
=
'/data/log/search_tips/app/'
# LOG_DIR = '/data/log/search_tips/app/'
LOG_DIR
=
'/Users/edz/Desktop/project/log/search_tips'
logging
.
basicConfig
(
level
=
logging
.
INFO
,
...
...
search_tips/log_settings.py_bak
View file @
2ccc7057
...
...
@@ -5,7 +5,8 @@
import
os
import
logging
LOG_DIR
=
'/data/log/search_tips/app/'
# LOG_DIR = '/data/log/search_tips/app/'
LOG_DIR
=
'/Users/edz/Desktop/project/log/search_tips'
logging
.
basicConfig
(
level
=
logging
.
INFO
,
...
...
trans2es/commons/words_utils.py
View file @
2ccc7057
...
...
@@ -231,23 +231,16 @@ 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:
# key = "save_sub_query_to_redis_v1"
# redis_data = redis_client.get(key)
# if redis_data:
# redis_data = json.loads(str(redis_data, encoding="utf8"))
# if lower_query in redis_data:
# return False
# else:
# redis_data.append(lower_query)
# redis_client.set(key, json.dumps(redis_data))
# return True
# else:
# redis_client.set(key, json.dumps([lower_query]))
# return True
lower_query
=
str
(
query
)
.
lower
()
key
=
"save_sub_query_to_redis"
if
type_v1
:
key
=
"save_sub_query_to_redis_v1"
redis_data
=
redis_client
.
hget
(
key
,
lower_query
)
if
redis_data
:
return
False
else
:
redis_client
.
hset
(
key
,
lower_query
,
json
.
dumps
(
1
))
return
True
# if from_type == "search_query":
# order_weight = cls.get_hot_search_query_word_weight(name=query)
# search_num = cls.get_search_query_results_num(name=query)
...
...
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