Commit d064ecd6 authored by lixiaofang's avatar lixiaofang

最新tab

parent 4e98b54b
......@@ -973,7 +973,18 @@ class TopicUtils(object):
"order": "desc"
},
})
if sorts_by == TOPIC_SEARCH_SORT.TOPIC_ADD_TIME:
sort_rule.append({
"related_billboard.topic_add_createtime": {
"order": "desc",
"nested_path": "related_billboard",
"nested_filter": {
"term": {
"related_billboard.pictorial_id": pictorial_id
}
}
},
})
elif isinstance(sorts_by, list):
for sort_by in sorts_by:
if sort_by == TOPIC_SEARCH_SORT.ID_AEC:
......@@ -1068,19 +1079,6 @@ class TopicUtils(object):
},
})
elif sort_by == TOPIC_SEARCH_SORT.TOPIC_ADD_TIME:
sort_rule.append({
"related_billboard.topic_add_createtime": {
"order": "desc",
"nested_path": "related_billboard",
"nested_filter": {
"term": {
"related_billboard.pictorial_id": pictorial_id
}
}
},
})
logging.info("get picotirial:%s" % sort_rule)
return sort_rule
......@@ -1098,10 +1096,16 @@ class TopicUtils(object):
}
}
if sorts_by:
sorts = cls.process_sort(sorts_by, pictorial_id=None)
if sorts:
q["sort"] = sorts
if 'pictorial_id' in filters.keys():
if sorts_by:
sorts = cls.process_sort(sorts_by, filters["pictorial_id"])
if sorts:
q["sort"] = sorts
else:
if sorts_by:
sorts = cls.process_sort(sorts_by, pictorial_id=None)
if sorts:
q["sort"] = sorts
result_dict = ESPerform.get_search_results(
ESPerform.get_cli(), sub_index_name=index_name,
......
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