public LuceneSort GetSort(IMember member, JobAdSearchQuery searchQuery) { switch (searchQuery.SortOrder) { case JobAdSortOrder.Relevance: // Default sort. return(null); case JobAdSortOrder.CreatedTime: return(_createdTimeHandler.GetSort(searchQuery)); case JobAdSortOrder.JobType: return(_jobTypesHandler.GetSort(searchQuery)); case JobAdSortOrder.Distance: return(_locationHandler.GetSort(searchQuery)); case JobAdSortOrder.Salary: return(_salaryHandler.GetSort(searchQuery)); case JobAdSortOrder.Flagged: return(new LuceneSort(new[] { new BoboCustomSortField(SearchFieldName.Id, !searchQuery.ReverseSortOrder, new SpecialsComparatorSource(false, _jobAdFlagListsQuery.GetFlaggedJobAdIds(member).Select(id => id.ToFieldValue()), SearchFieldName.Id)), SortField.FIELD_SCORE })); default: return(null); } }
public LuceneSort GetSort(ResourceSearchQuery query) { switch (query.SortOrder) { case ResourceSortOrder.Relevance: // Default sort. return(null); case ResourceSortOrder.CreatedTime: return(_createdTimeHandler.GetSort(query)); case ResourceSortOrder.Popularity: return(_popularityHandler.GetSort(query)); default: return(null); } }
public LuceneSort GetSort(IEmployer employer, MemberSearchQuery query) { switch (query.SortOrder) { case MemberSortOrder.Relevance: // Default sort. return(null); case MemberSortOrder.DateUpdated: return(_lastUpdatedHandler.GetSort(query)); case MemberSortOrder.Salary: return(_salaryHandler.GetSort(query)); case MemberSortOrder.Availability: return(_candidateStatusHandler.GetSort(query)); case MemberSortOrder.Flagged: return(new Sort(new[] { new BoboCustomSortField(SearchFieldName.Id, !query.ReverseSortOrder, new SpecialsComparatorSource(false, _candidateFlagListsQuery.GetFlaggedCandidateIds(employer).Select(id => id.ToFieldValue()), SearchFieldName.Id)), SortField.FIELD_SCORE })); case MemberSortOrder.FirstName: return(_nameHandler.GetSort(query)); case MemberSortOrder.Distance: return(_locationHandler.GetSort(query)); default: return(null); } }