EPiServer Find Sample

  • Basic
  • Sorting
  • Paging
  • Highlighting
  • Filters
  • Facets
  • Autocomplete
  • Map

Autocomplete Simple autocomplete by searching for the beginning of hotel names

Type something into the search box, such as "the".

View Source
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);
}