예제 #1
0
        public ActionResult Index(string q, int?p)
        {
            if (String.IsNullOrEmpty(q))
            {
                return(View(new SearchModel(new ContentItem[0])));
            }

            int totalRecords;
            var hits = CurrentItem.Search(q, p ?? 0, PAGE_SIZE, out totalRecords);

            return(View(new SearchModel(hits)
            {
                SearchTerm = q, TotalResults = totalRecords, PageSize = PAGE_SIZE, PageNumber = p ?? 0
            }));
        }