EPiServer Find Sample

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

Basic The simplest of search listings

Search for something related to hotels, such as "pool", "luxury" or "resort".

View Source
var results = client.Search<Hotel>()
    .For(q)
                        .Select(x => new SearchHit
                            {
                                Title = x.Name,
                                Url = x.Website,
                                Location = new List { x.ShortAddress, x.Location.Title, x.Location.Country.Title }.Concatenate(", "),
                                StarRating = (int) x.StarRating
                            })
    .GetResult();