Example #1
0
        private IList <Guid> GetSearchEngineMembers()
        {
            var criteria = new MemberSearchCriteria();

            criteria.SetKeywords("*");
            criteria.CandidateStatusFlags = CandidateStatusFlags.ActivelyLooking | CandidateStatusFlags.AvailableNow | CandidateStatusFlags.OpenToOffers | CandidateStatusFlags.Unspecified;
            criteria.HasResume            = true;
            criteria.IsActivated          = true;
            criteria.IsContactable        = true;

            // First determine how many there are.

            var execution = _executeMemberSearchCommand.Search(null, criteria, new Range(0, 1));
            var total     = execution.Results.TotalMatches;

            // Need to page.

            var       memberIds = new List <Guid>();
            var       start     = 0;
            const int page      = 1000;

            while (start < total)
            {
                execution = _executeMemberSearchCommand.Search(null, criteria, new Range(start, page));
                memberIds.AddRange(execution.Results.MemberIds);

                start += page;
            }

            return(memberIds);
        }
        private IList <RegisteredUser> MatchMembers(Criteria criteria)
        {
            var memberCriteria = criteria as MemberSearchCriteria;

            if (memberCriteria == null)
            {
                return(new List <RegisteredUser>());
            }

            var execution = _executeMemberSearchCommand.Search(null, memberCriteria, null);

            return(_membersQuery.GetMembers(from r in execution.Results.MemberIds select r).Cast <RegisteredUser>().ToList());
        }
Example #3
0
        private MemberSearchResults GetResults(IEmployer employer, MemberSearch savedResumeSearch, MemberSearchAlert alert)
        {
            // Clone the criteria before adjusted it for this search.

            var criteria = savedResumeSearch.Criteria.Clone();

            criteria.Recency = DateTime.Now - alert.LastRunTime;

            var execution = _executeMemberSearchCommand.Search(employer, criteria, new Range(0, MaxResults));

            _memberSearchAlertsCommand.UpdateLastRunTime(alert.MemberSearchId, DateTime.Now, _alertType);
            return(execution.Results);
        }
 private SearchEnginesModel CreateModel()
 {
     return(new SearchEnginesModel
     {
         MemberSearch = new MemberSearchEngineModel
         {
             TotalMembers = _executeMemberSearchCommand.Search(null, new MemberSearchCriteria(), new Range(0, 1)).Results.TotalMatches,
         },
         JobAdSearch = new JobAdSearchEngineModel
         {
             TotalJobAds = _executeJobAdSearchCommand.Search(null, new JobAdSearchCriteria(), new Range(0, 1)).Results.TotalMatches,
         }
     });
 }
        private MemberSearchExecution Execute(JobAd jobAd)
        {
            var criteria = _suggestedMembersQuery.GetCriteria(jobAd);

            var timer     = Stopwatch.StartNew();
            var execution = _executeMemberSearchCommand.Search(null, criteria, new Range(0, MaxSearchResults));

            timer.Stop();

            return(new MemberSearchExecution
            {
                Criteria = criteria,
                Context = MemberSearchContext.SuggestedCandidatesEmail,
                StartTime = DateTime.Now,
                Duration = timer.Elapsed,
                Results = execution.Results,
            });
        }
Example #6
0
 protected TListModel Search <TListModel>(IEmployer employer, MemberSearchCriteria criteria, CandidatesPresentationModel presentation)
     where TListModel : CandidateListModel, new()
 {
     return(Search <TListModel>(employer, presentation, (e, r) => _executeMemberSearchCommand.Search(e, criteria, r)));
 }
Example #7
0
 private ICollection <Guid> Search(IEmployer employer, MemberSearchCriteria criteria)
 {
     return(_executeMemberSearchCommand.Search(employer, criteria, null).Results.MemberIds);
 }
Example #8
0
 protected CandidatesResponseModel Search(IEmployer employer, MemberSearchCriteria criteria, Pagination pagination)
 {
     return(Search(employer, e => _executeMemberSearchCommand.Search(e, criteria, pagination.ToRange())));
 }
Example #9
0
 private MemberSearchResults GetSearchResults(IEmployer employer, MemberSearchCriteria criteria)
 {
     return(_executeMemberSearchCommand.Search(employer, criteria, null).Results);
 }