From 61c01a5e9bac507f571b60d9d10e6c9d8ade445e Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 24 Jan 2020 20:57:46 +0000 Subject: [PATCH] --- devdocs/todo.txt | 6 ++---- server/AyaNova/Startup.cs | 2 +- server/AyaNova/biz/Search.cs | 12 +++++++++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/devdocs/todo.txt b/devdocs/todo.txt index d0feddf0..cd02c7b3 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -56,10 +56,6 @@ cache or provide directly the locale to save time repeatedly fetching it when do /////////////////////////////////////////////////////////////////////////////// -TODO: Locale search data, there is overhead on every record save due to having to repeatedly fetch this - - While I added a way to seed it without fetching, there should actually just be a cached version for all record saving stored locally - - Fetches in the db are not necessary for this object more than once or on change of locale - - So probably Search code should cache it internally on first fetch TODO: RUN data list query with debug info on and see if any EF stuff is creeping into it @@ -149,6 +145,8 @@ TODO: Two kinds of mass fetch records in RAVEN - ACTION required: - Make sure the server supports this +TODO: locale cjkindex, no way to set this value currently + TODO: Licensing - make sure tech type use license works properly: a tech license is consumed if a user has **any one** of the four roles of TechFull, TechLimited, SubcontractorFull, SubcontractorLimited ### TODO FILTER ISSUE: SEE integration tests search for BUGBUG there are two tests failing in DataFilterFilteringLists tests that might be DST related TODO: JobsBiz::Create -> should log an event in order to be able to see who created a job, but maybe not for automatic internal jobs diff --git a/server/AyaNova/Startup.cs b/server/AyaNova/Startup.cs index 5cbfd6d3..27b8131f 100644 --- a/server/AyaNova/Startup.cs +++ b/server/AyaNova/Startup.cs @@ -449,7 +449,7 @@ namespace AyaNova { AyaNova.Core.License.Fetch(apiServerState, dbContext, _newLog); //NOTE: For unit testing make sure the time zone in util is set to the same figure as here to ensure list filter by date tests will work because server is on same page as user in terms of time - Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.MediumLocalServiceCompanyTrialDataSet, -7);//############################################################################################# + Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.LargeCorporateMultiRegionalTrialDataSet, -7);//############################################################################################# } //TESTING #endif diff --git a/server/AyaNova/biz/Search.cs b/server/AyaNova/biz/Search.cs index 96cbbf66..34209177 100644 --- a/server/AyaNova/biz/Search.cs +++ b/server/AyaNova/biz/Search.cs @@ -378,7 +378,7 @@ namespace AyaNova.Biz public long ObjectId { get; set; } public AyaType ObjectType { get; set; } public string Name { get; set; } - public List Words { get; set; } + public List Words { get; set; } @@ -389,7 +389,7 @@ namespace AyaNova.Biz LocaleId = localeId; ObjectId = objectID; ObjectType = objectType; - Name = name; + Name = name; } @@ -754,7 +754,13 @@ RETURNING id, xmin; /// used for eliminating noise words from search dictionary /// - public static Dictionary localeWordBreakingDataCache = new Dictionary(); + private static Dictionary localeWordBreakingDataCache = new Dictionary(); + //called by Locale in the rare circumstance that a local has changed that is cached + //and might affect word breaking (stopwords cjkindex etc) + internal static void ClearLocaleWordBreakingDataCache(long localeId) + { + localeWordBreakingDataCache.Remove(localeId); + } internal static List BreakCore(long localeId, bool KeepWildCards, List textStrings) {