This commit is contained in:
2018-09-19 19:49:43 +00:00
parent 250a4f9ecf
commit c695204051
4 changed files with 79 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ namespace AyaNova.Biz
/// </summary>
public enum AyaType : int
{
NotValid = 0,
NoType = 0,
Global = 1,
[Attachable, Taggable]

View File

@@ -28,6 +28,60 @@ namespace AyaNova.Biz
#region Search and return results
/*
Requirements:
INPUT PARAMETERS
- Search phrase (with wildcard support)
- Can be empty if tags are specified, no tags and no phrase is an error condition
- ObjectType: only return results for objects of this type
- InName: flag that indicates only search in names
- Tag ids that are also on result objects
- Can be empty if a phrase is specified
ACTION
Find search matches, then find tag matches then intersect, then sort and return
Filter OUT results that user is not permitted to read
//TODO: proper testing of searching
- SAMPLE DATA: Need a huge amount of sample data indexed to load test it
- INDEXES: play with it and see what works best
OUTPUT FORMAT
- No localized text, up to client
- Name of object in return result
- Object Type and ID in return result
- Group results by object type, then by object ID descending which will result in natural most recently created order
result:[
{
name:"blah",
type:2,
id:210
},
]
*/
//Class to hold search request parameters
public class SearchRequestParameter
{
public string Phrase {get;set;}
public bool NameOnly { get; set; }
public AyaType TypeOnly {get;set;}
public List<long> Tags { get; set; }
public SearchRequestParameter()
{
NameOnly = false;
TypeOnly=AyaType.
Tags = new List<long>();
}
}
//Class to hold search result
public class SearchResult
{
@@ -40,12 +94,15 @@ namespace AyaNova.Biz
}
}
public static async Task<List<SearchResult>> DoSearch(AyContext ct, long localeId, long objectID, AyaType objectType, string name, params string[] text)
{
List<SearchResult> ResultList=new List<SearchResult>();
//fake await to clear error
await ct.SaveChangesAsync();
//await ct.SaveChangesAsync();
return ResultList;
}