Commit 32ab1ed4 authored by zhanglu's avatar zhanglu

帖子某些字段范围搜索

parent 2c6284cc
...@@ -635,6 +635,29 @@ class TopicUtils(object): ...@@ -635,6 +635,29 @@ class TopicUtils(object):
} }
} }
}) })
elif k.startswith("__gte") or k.startswith("__lte") or \
k.startswith("__gt") or k.startswith("__lt"):
if k.startswith("__gte"):
op = "gte"
filed = k[:-5]
elif k == "__lte":
op = "lte"
filed = k[:-5]
elif k == "__gt":
op = "lte"
filed = k[:-4]
elif k == "__lt":
op = "lte"
filed = k[:-4]
f.append({
"range": {
filed: {
op: v,
}
}
})
else: else:
if isinstance(v, list): if isinstance(v, list):
f.append({ f.append({
......
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