Commit d8f6b664 authored by lixiaofang's avatar lixiaofang

add

parent 1a574134
...@@ -746,22 +746,47 @@ class TopicUtils(object): ...@@ -746,22 +746,47 @@ class TopicUtils(object):
for k, v in filters.items(): for k, v in filters.items():
if k == "content": if k == "content":
query = filters["content"] query = filters["content"]
q = { q = {}
"query": { # q = {
"bool": { # "query": {
"must": must, # "bool": {
"must_not": cls.process_nfilters(nfilters), # "must": must,
}, # "must_not": cls.process_nfilters(nfilters),
"multi_match": { # },
"fields": ["title", "content"], # "multi_match": {
"type": "cross_fields", # "fields": ["title", "content"],
"operator": "or", # "type": "cross_fields",
"query": query # "operator": "or",
# "query": query
#
# }
# }
# }
q["query"] = {
"function_score": {
"functions":[{
"filter": {
"bool": {
"must": must,
"must_not": cls.process_nfilters(nfilters),
}
},
"weight": 1
}],
"query": {
"multi_match": {
"fields": ["content"],
"type": "cross_fields",
"operator": "or",
"query": query
}
} }
} }
} }
logging.info("get query business_topic:%s"%q) logging.info("get query business_topic:%s" % q)
if sorts_by: if sorts_by:
sorts = cls.process_sort(sorts_by) sorts = cls.process_sort(sorts_by)
if sorts: if sorts:
......
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