コード例 #1
0
        public JsonResult Suggest(string text, bool isAccentVN = false)
        {
            if (!String.IsNullOrEmpty(text))
            {
                text = Regex.Replace(HttpUtility.HtmlDecode(text), @"<(.|\n)*?>", "");
            }

            if (isAccentVN)
            {
                text = _accent.GetAccentVN(text);
            }

            var lstSuggest = _elastic.AutoComplete(text);

            return(Json(lstSuggest, JsonRequestBehavior.AllowGet));
        }