I just created the site search module where I need to get all the pages that the user is looking for.
I'm able to get the item name when content matches the search term, But also I need the content field value for the description field.
I'm getting null value when I get that field, it is not stored ?
var searchResults = context.GetQueryable<SearchResultItem>()
.Where(x => (x.Content.Contains(searchkey) || x.Name.Contains(searchkey)) && x.Path.Contains(pathToBeSearch))
.Where(x => x.Language == ConfigurationItem.Language.Name)
.Where(x => !excludeTempltes.Contains(x.TemplateName))
.GetResults().Hits.Select(h => h.Document).ToArray();
foreach (SearchResultItem item in searchResults)
{
searchdata.Page_Title = item.Name;
searchdata.Page_Description = item.Content;
}