From d066e67082dd716616aa7fc99e748f302ba37da9 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 2 Sep 2021 18:24:39 +0000 Subject: [PATCH] --- .../AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs b/server/AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs index f722f0c8..834c1a60 100644 --- a/server/AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs +++ b/server/AyaNova/DataList/DataListSqlFilterCriteriaBuilder.cs @@ -1630,9 +1630,14 @@ namespace AyaNova.DataList Current equalto filter doesn't work with this type of query as it directly compares it as if it was one string instead of does it contain all those terms ### HOW IT SHOULD WORK ### + Equality: Exactly equal (aside from order) compare entire search term array to tag array in db - all terms in search exactly present and no others in db record + contains and also length is same as search terms length, in this example 1 is the number of search terms as the search is for {'green'} + WHERE ARRAY['green'::varchar(255)] <@ tags and array_length(tags,1) = 1 + 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 - + WHERE NOT (ARRAY['green'::varchar(255)] <@ tags and array_length(tags,1) = 1) + NO value: Empty tag array in db record db record tags has NO value where tags = '{}'