Commit 8eff6baf authored by Kai's avatar Kai

update

parent d0b88a4e
...@@ -370,16 +370,6 @@ class TopicUtils(object): ...@@ -370,16 +370,6 @@ class TopicUtils(object):
q = dict() q = dict()
q["query"] = dict() q["query"] = dict()
# logging.warning("topic_tag_list:%s"%str(topic_tag_list)) # logging.warning("topic_tag_list:%s"%str(topic_tag_list))
functions_list = [
{
"linear": {
"create_time": {
"scale": "1d",
"decay": 0.5
}
}
}
]
query_function_score = { query_function_score = {
"query": { "query": {
"bool": { "bool": {
...@@ -393,19 +383,15 @@ class TopicUtils(object): ...@@ -393,19 +383,15 @@ class TopicUtils(object):
} }
} }
} }
}, }
"score_mode": "sum", }
"boost_mode": "sum",
"functions": functions_list
}
query_function_score["query"]["bool"]["filter"] = { query_function_score["query"]["bool"]["filter"] = {
"terms": { "terms": {
"tag_list": useful_tag_list "tag_list": useful_tag_list
} }
} }
q["query"]["function_score"] = query_function_score
q["_source"] = { q["_source"] = {
"includes": ["id", "pictorial_id", "user_id", "_score"] "includes": ["id"]
} }
result_dict = ESPerform.get_search_results(es_cli_obj, sub_index_name=index_type, query_body=q, size=size, result_dict = ESPerform.get_search_results(es_cli_obj, sub_index_name=index_type, query_body=q, size=size,
......
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