Exemple #1
0
        public async Task <IActionResult> OnPost(string text, string segment)
        {
            _logger.LogDebug(text);
            if (string.IsNullOrEmpty(text))
            {
                Redirect("/");
            }

            var id = Guid.NewGuid().ToString();

            _logger.LogInformation($"{segment} : {id} - OnPost");
            var similarity = GetSimilarity(text, id);

            _redisStorage.StoreShard(id, segment);
            _redisStorage.Store(Const.SimilarityTitleKey + id, similarity.ToString(), segment);
            _redisStorage.Store(Const.TextTitleKey + id, text, segment);

            await CreateEventForSimilarity(id, similarity);
            await CreateRankCalculator(id);

            return(Redirect($"summary?id={id}"));
        }