Commit ce552cd5 authored by 许俊鹏's avatar 许俊鹏

更改range范围查询

parent 387dc6b3
......@@ -556,6 +556,7 @@ class TopicUtils(object):
f = [
{"term": {"is_deleted": False}},
]
_range = {}
if not filters:
return f
......@@ -568,16 +569,10 @@ class TopicUtils(object):
if k == "create_time_gte":
op = "gte"
_range.update({op:v})
elif k == "create_time_lte":
op = "lte"
f.append({
"range": {
"create_time_val": {
op: v,
}
}
})
_range.update({op: v})
else:
if isinstance(v, list):
f.append({
......@@ -587,7 +582,7 @@ class TopicUtils(object):
f.append({
"term": {k: v},
})
f.append({"range": {"create_time_val": _range}})
if filter_online:
f.append({"term": {"is_online": True}})
......
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