From 06dc6efc30a601ab93850eae8c62f51f9a6125b3 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 23 Dec 2020 23:53:37 +0000 Subject: [PATCH] --- server/AyaNova/biz/CustomerBiz.cs | 58 ++++++++++++++++++++++++++++--- server/AyaNova/biz/Search.cs | 7 ++++ 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/server/AyaNova/biz/CustomerBiz.cs b/server/AyaNova/biz/CustomerBiz.cs index 684edd64..85bf5989 100644 --- a/server/AyaNova/biz/CustomerBiz.cs +++ b/server/AyaNova/biz/CustomerBiz.cs @@ -220,7 +220,32 @@ namespace AyaNova.Biz private async Task SearchIndexAsync(Customer obj, bool isNew) { var SearchParams = new Search.SearchIndexProcessObjectParameters(UserTranslationId, obj.Id, BizType); - SearchParams.AddText(obj.Notes).AddText(obj.Name).AddText(obj.Wiki).AddText(obj.Tags).AddCustomFields(obj.CustomFields); + SearchParams.AddText(obj.Notes) + .AddText(obj.Name) + .AddText(obj.Wiki) + .AddText(obj.Tags) + .AddText(obj.WebAddress) + .AddText(obj.PopUpNotes) + .AddText(obj.TechNotes) + .AddText(obj.AccountNumber) + .AddText(obj.Phone1) + .AddText(obj.Phone2) + .AddText(obj.Phone3) + .AddText(obj.Phone4) + .AddText(obj.Phone5) + .AddText(obj.EmailAddress) + .AddText(obj.PostAddress) + .AddText(obj.PostCity) + .AddText(obj.PostRegion) + .AddText(obj.PostCountry) + .AddText(obj.PostCode) + .AddText(obj.Address) + .AddText(obj.City) + .AddText(obj.Region) + .AddText(obj.Country) + .AddText(obj.Latitude) + .AddText(obj.Longitude) + .AddCustomFields(obj.CustomFields); if (isNew) await Search.ProcessNewObjectKeywordsAsync(SearchParams); else @@ -231,8 +256,33 @@ namespace AyaNova.Biz { var obj = await ct.Customer.SingleOrDefaultAsync(z => z.Id == id); var SearchParams = new Search.SearchIndexProcessObjectParameters(); - if (obj != null) - SearchParams.AddText(obj.Notes).AddText(obj.Name).AddText(obj.Wiki).AddText(obj.Tags).AddCustomFields(obj.CustomFields); + if (obj != null)todo: test this out and see what comes back from various searches, is it correctly showing a summary? + SearchParams.AddText(obj.Notes) + .AddText(obj.Name) + .AddText(obj.Wiki) + .AddText(obj.Tags) + .AddText(obj.WebAddress) + .AddText(obj.PopUpNotes) + .AddText(obj.TechNotes) + .AddText(obj.AccountNumber) + .AddText(obj.Phone1) + .AddText(obj.Phone2) + .AddText(obj.Phone3) + .AddText(obj.Phone4) + .AddText(obj.Phone5) + .AddText(obj.EmailAddress) + .AddText(obj.PostAddress) + .AddText(obj.PostCity) + .AddText(obj.PostRegion) + .AddText(obj.PostCountry) + .AddText(obj.PostCode) + .AddText(obj.Address) + .AddText(obj.City) + .AddText(obj.Region) + .AddText(obj.Country) + .AddText(obj.Latitude) + .AddText(obj.Longitude) + .AddCustomFields(obj.CustomFields); return SearchParams; } @@ -311,7 +361,7 @@ namespace AyaNova.Biz // //the translation key is to indicate what the linked object is that is causing the error // AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", "LT:Contact"); // } - + await Task.CompletedTask; } diff --git a/server/AyaNova/biz/Search.cs b/server/AyaNova/biz/Search.cs index edc47edb..e4579383 100644 --- a/server/AyaNova/biz/Search.cs +++ b/server/AyaNova/biz/Search.cs @@ -623,6 +623,13 @@ namespace AyaNova.Biz return this; } + public SearchIndexProcessObjectParameters AddText(decimal? d) + { + if (d != null) + Words.Add(d.ToString()); + return this; + } + public SearchIndexProcessObjectParameters AddText(List lWords) { if (lWords != null)