Fix context view for certain mtypes
This commit is contained in:
parent
2153054cac
commit
eb7ff88c15
|
@ -108,7 +108,7 @@ class ElasticsearchBackend(StorageBackend):
|
||||||
extra_should.append({"match": {"nick": channel}})
|
extra_should.append({"match": {"nick": channel}})
|
||||||
else:
|
else:
|
||||||
for ctype in types:
|
for ctype in types:
|
||||||
extra_should.append({"equals": {"mtype": ctype}})
|
extra_should.append({"match": {"mtype": ctype}})
|
||||||
else:
|
else:
|
||||||
for ctype in types:
|
for ctype in types:
|
||||||
extra_should.append({"match": {"type": ctype}})
|
extra_should.append({"match": {"type": ctype}})
|
||||||
|
|
|
@ -4,7 +4,7 @@ def construct_query(index, net, channel, src, num, size, type=None, nicks=None):
|
||||||
extra_should = []
|
extra_should = []
|
||||||
extra_should2 = []
|
extra_should2 = []
|
||||||
if num:
|
if num:
|
||||||
extra_must.append({"equals": {"num": num}})
|
extra_must.append({"match_phrase": {"num": num}})
|
||||||
if net:
|
if net:
|
||||||
extra_must.append({"match_phrase": {"net": net}})
|
extra_must.append({"match_phrase": {"net": net}})
|
||||||
if channel:
|
if channel:
|
||||||
|
@ -52,7 +52,7 @@ def construct_query(index, net, channel, src, num, size, type=None, nicks=None):
|
||||||
extra_should.append({"match": {"nick": channel}})
|
extra_should.append({"match": {"nick": channel}})
|
||||||
else:
|
else:
|
||||||
for ctype in types:
|
for ctype in types:
|
||||||
extra_should.append({"equals": {"mtype": ctype}})
|
extra_should.append({"match": {"mtype": ctype}})
|
||||||
else:
|
else:
|
||||||
for ctype in types:
|
for ctype in types:
|
||||||
extra_should.append({"match": {"type": ctype}})
|
extra_should.append({"match": {"type": ctype}})
|
||||||
|
|
Loading…
Reference in New Issue