public List <RaceSearchResultDto> GetSearch(string query, DateTimeOffset?date) { var tokens = tokenizer.GetTokens(query); var entries = racesIndexRepository.Search(tokens, date); return(entries.Select(BuildSearchResult).ToList()); }
private RaceIndexEntry BuildIndexEntry(string raceId, RaceSettings raceSettings) { return(new RaceIndexEntry { RaceId = raceId, Name = raceSettings.Name, Start = raceSettings.Start, End = raceSettings.End, SearchTokens = tokenizer.GetTokens(raceSettings.Name) }); }