This commit is contained in:
2021-10-11 20:02:05 +00:00
parent 0f8773bde4
commit 697a4ca593

View File

@@ -197,11 +197,13 @@ namespace AyaNova.Biz
//EXACT MATCH SEARCH TERMS //EXACT MATCH SEARCH TERMS
foreach (string Term in SearchTerms) foreach (string Term in SearchTerms)
q.Append($"COUNT(*) FILTER (WHERE asearchdictionary.word = '{Term}') AS 'st{++termCount}', "); q.Append($"COUNT(*) FILTER (WHERE asearchdictionary.word = '{Term}') AS st{++termCount}, ");
//WILDCARD SEARCH TERMS //WILDCARD SEARCH TERMS
foreach (string WildCardSearchTerm in PreWildCardedSearchTerms) foreach (string WildCardSearchTerm in PreWildCardedSearchTerms)
q.Append($"COUNT(*) FILTER (WHERE asearchdictionary.word LIKE '{WildCardSearchTerm}') AS 'st{++termCount}', "); q.Append($"COUNT(*) FILTER (WHERE asearchdictionary.word LIKE '{WildCardSearchTerm}') AS st{++termCount}, ");
q.Length=q.Length-2;//trim the final comma and space
q.Append(" FROM asearchdictionary INNER JOIN asearchkey ON asearchdictionary.id = asearchkey.wordid GROUP BY asearchkey.objectid, asearchkey.atype) SELECT objectid, atype FROM qr WHERE "); q.Append(" FROM asearchdictionary INNER JOIN asearchkey ON asearchdictionary.id = asearchkey.wordid GROUP BY asearchkey.objectid, asearchkey.atype) SELECT objectid, atype FROM qr WHERE ");