Autocomplete Simple autocomplete by searching for the beginning of hotel names
Type something into the search box, such as "the".
public JsonResult Prefix(string term) { var results = client.Search<Hotel>() .Filter(x => x.Name.PrefixCaseInsensitive(term)) .Select(x => x.Name) .StaticallyCacheFor(TimeSpan.FromHours(1)) .GetResult(); return Json(results.Select(x => x), JsonRequestBehavior.AllowGet); }