Example #1
0
        public IActionResult EdgeNGram(string searchedContent)
        {
            ESReadSuggestionsManager client = new ESReadSuggestionsManager();
            var searchResult = client
                               .EdgeNGramSearch(searchedContent);

            return(Ok(searchResult.Documents));
        }
Example #2
0
        public IActionResult CompletionSuggester(string searchedContent)
        {
            ESReadSuggestionsManager client = new ESReadSuggestionsManager();
            var searchResult = client
                               .CompletionSuggesterSearch(searchedContent);

            var results = searchResult.Suggest?.FirstOrDefault().Value?.FirstOrDefault()?.Options?.Select(s => new { Suggestion = s.Text });

            return(Ok(results));
        }