Commit 00689d75 authored by lixiaofang's avatar lixiaofang

add

parent 7d8cbd2f
......@@ -744,28 +744,12 @@ class TopicUtils(object):
must = cls.process_filters(filters, filter_online=filter_online)
query = ''
for k, v in filters.items():
if k == "content":
if k == "content" or k == "id":
query = filters["content"]
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":[{
"functions": [{
"filter": {
"bool": {
"must": must,
......@@ -776,7 +760,7 @@ class TopicUtils(object):
}],
"query": {
"multi_match": {
"fields": ["content","id","content_level","user_id","pictorial_id"],
# "fields": ["content", "id", "content_level", "user_id", "pictorial_id"],
"type": "cross_fields",
"operator": "or",
"query": query
......@@ -809,7 +793,6 @@ class TopicUtils(object):
"total_count": 0
}
@classmethod
def business_topic_id(cls, filters, nfilters, sorts_by, offset=0, size=10, index_name="topic", filter_online=True):
......@@ -820,15 +803,14 @@ class TopicUtils(object):
if k == "content":
query = filters["content"]
match={
"match":{
"content":{
match = {
"match": {
"content": {
query
}
}
}
q = {
"query": {
"bool": {
......
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