public async Task <List <DocumentSearchOutput> > SearchAsync(DocumentSearchInput input) { var project = await _projectRepository.GetAsync(input.ProjectId); var esDocs = await _documentFullSearch.SearchAsync(input.Context, project.Id, input.LanguageCode, input.Version); return(esDocs.Select(esDoc => new DocumentSearchOutput//TODO: auto map { Name = esDoc.Name, FileName = esDoc.FileName, Version = esDoc.Version, LanguageCode = esDoc.LanguageCode, Highlight = esDoc.Highlight }).ToList()); }
public async Task <List <DocumentSearchOutput> > SearchAsync(DocumentSearchInput input) { var project = await _projectRepository.GetAsync(input.ProjectId); input.Version = GetProjectVersionPrefixIfExist(project) + input.Version; var esDocs = await _documentFullSearch.SearchAsync(input.Context, project.Id, input.LanguageCode, input.Version); return(esDocs.Select(esDoc => new DocumentSearchOutput //TODO: auto map { Name = esDoc.Name, FileName = esDoc.FileName, Version = esDoc.Version, LanguageCode = esDoc.LanguageCode, Highlight = esDoc.Highlight }).Where(x => x.FileName != project.NavigationDocumentName && x.FileName != project.ParametersDocumentName).ToList()); }