Fix context view for certain mtypes

This commit is contained in:
Mark Veidemanis 2023-02-01 07:20:31 +00:00
parent 2153054cac
commit eb7ff88c15
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 3 additions and 3 deletions

View File

@ -108,7 +108,7 @@ class ElasticsearchBackend(StorageBackend):
extra_should.append({"match": {"nick": channel}})
else:
for ctype in types:
extra_should.append({"equals": {"mtype": ctype}})
extra_should.append({"match": {"mtype": ctype}})
else:
for ctype in types:
extra_should.append({"match": {"type": ctype}})

View File

@ -4,7 +4,7 @@ def construct_query(index, net, channel, src, num, size, type=None, nicks=None):
extra_should = []
extra_should2 = []
if num:
extra_must.append({"equals": {"num": num}})
extra_must.append({"match_phrase": {"num": num}})
if net:
extra_must.append({"match_phrase": {"net": net}})
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}})
else:
for ctype in types:
extra_should.append({"equals": {"mtype": ctype}})
extra_should.append({"match": {"mtype": ctype}})
else:
for ctype in types:
extra_should.append({"match": {"type": ctype}})