Commit d8f6b664 authored by lixiaofang's avatar lixiaofang

add

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