Commit e8d5e9b8 authored by lixiaofang's avatar lixiaofang

is_online

parent cdbf5809
......@@ -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:
......
......@@ -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_online
item_dict["is_online"] = False if instance.is_delete else True
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_online
item_dict["is_online"] = False if instance.is_delete else True
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment