This commit is contained in:
2018-09-28 18:10:47 +00:00
parent 70fc47177f
commit d1b6a7d747
4 changed files with 54 additions and 7 deletions

View File

@@ -72,12 +72,14 @@ namespace AyaNova.Biz
public bool NameOnly { get; set; }
public AyaType TypeOnly { get; set; }
public List<long> Tags { get; set; }
public int MaxResults { get; set; }
public SearchRequestParameters()
{
NameOnly = false;
TypeOnly = AyaType.NoType;
Tags = new List<long>();
MaxResults = 500;
}
public bool IsValid
@@ -313,6 +315,11 @@ namespace AyaNova.Biz
MatchingObjects = CanReadMatchingObjects;
}
//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...
MatchingObjects=MatchingObjects.Take(searchParameters.MaxResults).ToList();
//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);
@@ -445,7 +452,7 @@ namespace AyaNova.Biz
}
ct.SearchKey.AddRange(NewSearchKeyList);
ct.SaveChanges();
//---------------------------------