Esempio n. 1
0
        public SearchResult DoSearch(BasicSearch search)
        {
            var newSearch = Mapper.Map<BasicSearch, emSearch>(search);
            if (string.IsNullOrEmpty(search.Query))
            {
                newSearch.CustomQuery = new Dictionary<string, emSearch.SearchTerm>
                {
                    {"Type", new emSearch.SearchTerm {Field = "User", Term = Occur.SHOULD}}
                };
            }
            else
            {
                newSearch.CustomQuery = new Dictionary<string, emSearch.SearchTerm>
                {
                    {"Username", new emSearch.SearchTerm {Field = search.Query, Term = Occur.SHOULD}},
                    {"Forename", new emSearch.SearchTerm {Field = search.Query, Term = Occur.SHOULD}},
                    {"Surame", new emSearch.SearchTerm {Field = search.Query, Term = Occur.SHOULD}},
                    {"Email", new emSearch.SearchTerm {Field = search.Query, Term = Occur.SHOULD}}//,
                    //{"Archived", new emSearch.SearchTerm {Field = "False", Term = Occur.SHOULD}}
                };
            }
            return searchManager.DoSearch(newSearch);
            //  var result = _rawResults = searchManager.DoSearch(newSearch);
            /*
                        if (result.Items.HasContent())
                        {
                            return Mapper.Map <IEnumerable<repUsers.User>,IEnumerable<User>> (userRep.Fetch(result.Items.Select(n => n.ID).ToList()));
                        }*/

            return null;
        }
Esempio n. 2
0
 public SearchResult DoSearch(BasicSearch search)
 {
     throw new NotImplementedException();
 }
Esempio n. 3
0
 public SearchResult DoSearch(BasicSearch search)
 {
     var newSearch = AutoMapper.Mapper.Map<BasicSearch, emSearch>(search);
     if (string.IsNullOrEmpty(search.Query))
     {
         newSearch.CustomQuery = new Dictionary<string, emSearch.SearchTerm>
         {
             {"Type", new emSearch.SearchTerm {Field = "Role", Term = Occur.SHOULD}}
         };
     }
     else
     {
         newSearch.CustomQuery = new Dictionary<string, emSearch.SearchTerm>
         {
             {"Name", new emSearch.SearchTerm {Field = search.Query, Term = Occur.SHOULD}}
         };
     }
     return SearchManager.DoSearch(newSearch);
 }