From 94e32005ca1e4f862be062c91e21ff90daf4d914 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat, 17 Dec 2022 19:49:17 -0800 Subject: [PATCH] support `tags__id__none` for advanced search --- src/documents/index.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/documents/index.py b/src/documents/index.py index fe40dc1a8..e9c340697 100644 --- a/src/documents/index.py +++ b/src/documents/index.py @@ -143,6 +143,9 @@ class DelayedQuery: elif k == "tags__id__all": for tag_id in v.split(","): criterias.append(query.Term("tag_id", tag_id)) + elif k == "tags__id__none": + for tag_id in v.split(","): + criterias.append(query.Not(query.Term("tag_id", tag_id))) elif k == "document_type__id": criterias.append(query.Term("type_id", v)) elif k == "correspondent__isnull":