Commit 7f85e762 authored by 高雅喆's avatar 高雅喆

词映射标签过程中增加5级标签

parent 5f1896e7
...@@ -174,6 +174,10 @@ if __name__ == '__main__': ...@@ -174,6 +174,10 @@ if __name__ == '__main__':
# gm_kv_cli.set(search_words_synonym_tags_key, search_words_synonym_tags_json) # gm_kv_cli.set(search_words_synonym_tags_key, search_words_synonym_tags_json)
redis_client.set(search_words_synonym_tags_key, search_words_synonym_tags_json) redis_client.set(search_words_synonym_tags_key, search_words_synonym_tags_json)
# 词的tag缓存hash
search_words_synonym_tags_hash_key = "gm:home:feed:words:tag"
redis_client.hmset(search_words_synonym_tags_hash_key, all_word_tags)
# rdd # rdd
sparkConf = SparkConf().set("spark.hive.mapred.supports.subdirectories", "true") \ sparkConf = SparkConf().set("spark.hive.mapred.supports.subdirectories", "true") \
.set("spark.hadoop.mapreduce.input.fileinputformat.input.dir.recursive", "true") \ .set("spark.hadoop.mapreduce.input.fileinputformat.input.dir.recursive", "true") \
......
...@@ -136,7 +136,7 @@ def get_all_api_tags(): ...@@ -136,7 +136,7 @@ def get_all_api_tags():
:return:dict {"search_word1":[tag_list1],"search_word2":[tag_list2]...} :return:dict {"search_word1":[tag_list1],"search_word2":[tag_list2]...}
""" """
try: try:
sql = "select name, id from api_tag where tag_type+0<'4'+0 and is_online=1" sql = "select name, id from api_tag where tag_type in ('1', '2', '3', '5') and is_online=1"
mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'work', 'BJQaT9VzDcuPBqkd', 'zhengxing', sql) mysql_results = get_data_by_mysql('172.16.30.141', 3306, 'work', 'BJQaT9VzDcuPBqkd', 'zhengxing', sql)
result_dict = dict() result_dict = dict()
for data in mysql_results: for data in mysql_results:
......
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