/// <summary> /// Processes the data. /// </summary> /// <param name="searchRecord"></param> public List <DocumentIdentityRecord> GetDocuments(ReviewsetSearchRecord searchRecord) { var documents = new List <DocumentIdentityRecord>(); try { var searchContext = searchRecord.QueryEntity; searchContext.DocumentCount = searchRecord.TotalDocumentCount; searchContext.DocumentStartIndex = 0; searchRecord.QueryEntity.TransactionName = searchContext.TransactionName = "SearchWorker - GetDocuments"; searchContext.TotalRecallConfigEntity.IsTotalRecall = true; MockSession(); var searchResults = SearchBo.Search(searchContext, true); if (searchResults != null && searchResults.Documents != null && searchResults.Documents.Any()) { searchResults.Documents.ForEach(r => documents.Add(ConvertToDocumentIdentityRecord(r))); } } catch (Exception ex) { ex.Trace().Swallow(); Tracer.Error("SearchWorker - GetDocuments : {0}", ex); throw; } return(documents); }
/// <summary> /// Get document list by velocity search. /// Get document list by Searching in search sub-system /// </summary> /// <returns></returns> private List <string> GetDocumentsBySearch(DocumentQueryEntity queryEntity) { queryEntity.ShouldNotBe(null); var documentId = new List <string>(); queryEntity.TransactionName = "ExportStartupWorker - GetDocumentsBySearch"; var results = (RvwReviewerSearchResults)SearchBo.Search(queryEntity); if (results == null || results.Documents == null || !results.Documents.Any()) { return(documentId); } documentId.AddRange(results.Documents.Select(document => document.DocumentId.DocumentId)); return(documentId); }
/// <summary> /// This method fetch the documents from search engine for the given search context /// </summary> public List <BulkDocumentInfoBEO> GetDocuments(DocumentQueryEntity searchContext) { var tagDocuments = new List <BulkDocumentInfoBEO>(); searchContext.TransactionName = "TagStartupWorker - GetDocuments"; var watch = new Stopwatch(); watch.Start(); var searchResults = SearchBo.Search(searchContext, true); watch.Stop(); Tracer.Info("Total time in retrieving document(s) from Search sub-system is {0} milli seconds", watch.Elapsed.TotalMilliseconds); if (searchResults.Documents.Any()) { searchResults.Documents.ForEach(r => tagDocuments.Add(ConvertToDocumentIdentityRecord(r))); } return(tagDocuments); }