This commit is contained in:
2021-10-11 18:43:09 +00:00
parent 7cb1ec3b77
commit ceb655e761

View File

@@ -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<long> DictionaryMatches = new List<long>();