This commit is contained in:
2018-10-01 22:38:49 +00:00
parent 020e1b21ba
commit 9022300749
2 changed files with 13 additions and 9 deletions

View File

@@ -326,31 +326,26 @@ namespace AyaNova.Biz
//MAXIMUM RESULTS FILTER
//The theory is that it should be filtered BEFORE sorting so that you get the most random collection of results
//As the results are not ranked so...
var watch = new System.Diagnostics.Stopwatch();//###################### PROFILING
watch.Start();//###################### PROFILING
if (searchParameters.MaxResults > 0)//0 = all results
MatchingObjects = MatchingObjects.Take(searchParameters.MaxResults).ToList();
watch.Stop();//###################### PROFILING
var TimeToMaximumResultsFilter = watch.ElapsedMilliseconds;//###################### PROFILING
watch.Reset();
watch.Start();//###################### PROFILING
//Sort and group the matching objects list in return order
//Customer.OrderBy(c => c.LastName).ThenBy(c => c.FirstName)
var OrderedMatchingObjects = MatchingObjects.OrderBy(x => x.ObjectType).ThenByDescending(x => x.ObjectId);
watch.Stop();//###################### PROFILING
var TimeToOrderMatchingObjects = watch.ElapsedMilliseconds;//###################### PROFILING
watch.Reset();
var watch = new System.Diagnostics.Stopwatch();//###################### PROFILING
watch.Start();//###################### PROFILING
watch.Start();//###################### PROFILING
//Build the return list from the remaining matching objects list
//BUGBUG: THIS is what is taking all the time in the search FFS!
foreach (AyaTypeId i in OrderedMatchingObjects)
{
SearchResult SR = new SearchResult();
//SR.Name = "BLAH";
SR.Name = BizObjectNameFetcher.Name(i, ct);//THIS IS PROBABLY CAUSING ALL THE SLOWNESS
SR.Id = i.ObjectId;
SR.Type = i.ObjectType;