From b05c8f56563d9f8bc3e41938be855d8d7e39afbb Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 2 Sep 2021 17:58:52 +0000 Subject: [PATCH] --- .../AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs b/server/AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs index 1411dc3b..92aad5c3 100644 --- a/server/AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs +++ b/server/AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs @@ -1602,6 +1602,7 @@ namespace AyaNova.DataList { //Build tags filter fragment //https://www.postgresql.org/docs/current/functions-array.html + //https://www.postgresql.org/docs/9.1/functions-array.html /* For these reasons, am requesting the ability to filter on the Tag column to include: @@ -1633,8 +1634,14 @@ namespace AyaNova.DataList Not equal: Not EXACTLY Equal (aside from order) All terms in search term array NOT present in All terms in db record. IOW if db record has all search terms but also one more tag then it's NOT equal, Order doesn't matter NO value: Empty tag array in db record Has value: Non empty tag array in db record + Contains: All terms in search query present in db record, db record may have other tags but that's ok as long as it has the search term ones (order insensitive) + db record Tags contains search tags (and maybe also other tags) + WHERE ARRAY['red','green'::varchar(255)] <@ tags + Not contains: All terms in search query *NOT* present in db record, don't care what else is in db record as long as it's not the search terms (order insensitive) + db record Tags DOES NOT contain search tags + WHERE NOT ARRAY['red','green'::varchar(255)] <@ tags This method and choices ensures users don't need to make a separate row for each one they can just treat the entire tag collection like they treat a single word match in a text field */