This commit is contained in:
2020-12-23 23:53:37 +00:00
parent 1f290127e5
commit 06dc6efc30
2 changed files with 61 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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<string> lWords)
{
if (lWords != null)