The sxacontent
computed field is used for searching. In the SXA you will find Search Box where you can search for items. We are using that computed field which aggregate texts form whole item (and related items in some cases) so that you could easily find a particular item.
Now... You don't need to manually access fields in the index (unless you have a purpose of doing that). Sitecore search providers will handle everything for you. And when you have SXA installed if you would like to display different data all you need to do is to play with Rendering Variant. For example, if I would like to display Office hours
and Key information
fields in the SXA Search Results rendering I just need to define a Rendering Variant:
If you are more advanced and you would like to play with the queries in code here is an example:
//get search index
ISearchIndex searchIndex = IndexResolver.ResolveIndex(Sitecore.Context.Item);
//create query
IQueryable<ContentPage> queryable = LinqHelper.CreateQuery<ContentPage>(searchIndex.CreateSearchContext(), new List<SearchStringModel>());
//play with the query (e.g. use fields from your template)
queryable = queryable.Where(x => x.Name == "MyName");
//get items which match your query
IEnumerable<Item> items = query.Select(r => r.GetItem());
I'm using here some SXA specific services like IIndexResolver
or classes ContentPage
. If you would like to use pure Sitecore Content Search API just google for it, there is plenty of tutorials.