// GET: API/ContentSearch public object Index(string text) { var configuration = new ContentSearchConfiguration(text, 10); var results = _contentSearchService.Search(configuration); return(JsonConvert.SerializeObject(new ApiSuccessResponse(results))); }
public PagedSearchResult <ISearchResult> Search(ISearchContext searchContext, Item dataSource) { using (_log.WithLogScope(this, logLevel: LogLevel.Debug)) { var pinnedResults = _pinnedSearchResultsFactory.Create(dataSource); var searchResults = _searchService.Search(searchContext, SiteContext.Current).Results.Skip(Skip(dataSource)); var final = pinnedResults.Concat(searchResults).ToList(); return(new PagedSearchResult <ISearchResult>(searchContext.PaginationOptions, final.Count, final)); } }
private ActionResult DoSearch(bool isCollectionSearch) { // do work and set search results and search context in the context store for renderings to use downstream var searchContext = HttpContext.SearchContext(); var searchResults = contentSearchService.Search(searchContext, Sitecore.Context.Site, isCollectionSearch); this.contextStore.Add(searchResults); this.contextStore.Add(searchContext); // call the base implementation return(base.Index()); }
public ActionResult Search(string input) { return(View("Index", _searchService.Search(input).Select(x => _contentService.GetContentById(x).ToContentViewModel()))); }