Commit 2e1278d0 authored by 段英荣's avatar 段英荣

modify

parent d0bcfa5e
......@@ -132,11 +132,6 @@ class TopicUtils(object):
q = dict()
q["query"] = dict()
q["query"]["bool"] = {
"must":{
"range": {"content_level": {"gte": 3, "lte": 5}}
}
}
"""
q["filter"] = {
"range": {"content_level": {"gte": 3, "lte": 5}}
......@@ -162,13 +157,13 @@ class TopicUtils(object):
"weight": 5,
},
{
"filter": {"match": {
"user_id": pick_user_id_term_list}},
"filter": {"bool": {
"should": pick_user_id_term_list}},
"weight": 3
},
{
"filter": {"match": {
"user_id": same_group_user_id_term_list}},
"filter": {"bool": {
"should": same_group_user_id_term_list}},
"weight": 2
}
]
......@@ -177,7 +172,10 @@ class TopicUtils(object):
query_function_score = {
"query": {
"bool": {
"should": query_tag_term_list
"should": query_tag_term_list,
"must": {
"range": {"content_level": {"gte": 3, "lte": 5}}
}
}
},
"score_mode": "sum",
......@@ -199,12 +197,16 @@ class TopicUtils(object):
'operator': 'and',
'fields': query_fields,
}
query_function_score["query"]["bool"]["should"].append({'multi_match': multi_match})
"""
q["query"]["bool"] = {
"should": [
{'multi_match': multi_match}
],
"minimum_should_match": 1
}
}
"""
q["_source"] = {
"include":["id","group_id"]
}
......
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