From ceb655e761432e2734dbe3f6623aafbdd0e65ee5 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 11 Oct 2021 18:43:09 +0000 Subject: [PATCH] --- server/AyaNova/biz/Search.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/server/AyaNova/biz/Search.cs b/server/AyaNova/biz/Search.cs index eb27f3e5..1f9636fc 100644 --- a/server/AyaNova/biz/Search.cs +++ b/server/AyaNova/biz/Search.cs @@ -106,6 +106,28 @@ namespace AyaNova.Biz } + +/* +this query will do what I want properly. The wildcards here are just for wildcard terms and can also be direct matches doesn't matter the end result is only matches where all terms match the record +however they are desired i.e. AND not OR which is better than v7 which was shit at this as the wildcard search returned all it's results and so did any other terms +So I just need to build this query in this form from the search query terms, put them into the MatchingObjects collection and then the rest will fall into place and can resume as normal + + +WITH qr AS (SELECT aSearchKey.ObjectID, aSearchKey.aType, +count(*) FILTER (WHERE asearchdictionary.word like '%1qt%') AS "st1", +count(*) FILTER (WHERE asearchdictionary.word like '%44%') AS "st2" +FROM aSearchDictionary INNER JOIN aSearchKey ON aSearchDictionary.id = aSearchKey.WordID +group by asearchkey.objectid, asearchkey.atype) +select objectid, atype FROM qr +WHERE st1 > 0 and st2 >0 +order by atype, objectid + +*/ + + + + + //List holder for matching dictionary ID's List DictionaryMatches = new List();