This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
//---------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user