public IActionResult ProcessFile([FromForm(Name = "uploadedFile")] IFormFile formFile) { IndexedDocument document; using (var stream = formFile.OpenReadStream()) { document = indexer.ProcessDocument(formFile.FileName, stream); } var result = similarityDetectionAlgorithm.GetScore(document, DetectionStrategy.ByPhrase); TempData["resultModels"] = JsonConvert.SerializeObject(ResultModel.FromDictionary(result)); return(RedirectToAction("CheckResults", "Home", routeValues: new { fileName = formFile.FileName })); }
public void ProvisionFromDirectory(DirectoryInfo directory) { var indexedFiles = directory.GetFiles().Select(file => indexer.ProcessDocument(file.FullName)); luceneService.AddDocuments(indexedFiles); }