As per the title, during indexing, does Sitecore index the whole of the content tree (content, layout, media library, social, system, templates)? Is the section of the tree which is indexable configured somewhere, or is content to index controlled by configuring the template types to include/exclude?
If you are asking about the default Sitecore indexes,
sitecore_web_index, then the entire Sitecore content tree is indexed.
The part of the tree to include in the index is set by the
crawler/Root element in configuration:
<sitecore> <contentSearch> <configuration> <indexes hint="list:AddIndex"> <index id="sitecore_master_index"> <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" /> <locations hint="list:AddCrawler"> <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch"> <Database>master</Database> <Root>/sitecore</Root> </crawler> </locations> </index> </indexes> </configuration> </contentSearch> </sitecore>
Note that the default is
/sitecore, i.e. the entire tree. Also notice that the
locations node has a hint list attribute. You can add multiple crawlers for different parts of the tree in the single index if you require.
Also depending on the
configuration setting, items might not be included in the index if the
documentOptions setting excludes specific templates for example. The above is using the
defaultSolrIndexConfiguration which only excludes Bucket Folders. You should check your specific configuration to check the settings.
As a warning, do not restrict the Root setting of any of the default indexes. This will cause issues with parts of the internal application that rely on these indexes to function correctly, such as the search boxes in the Content Editor, field with search (e.g. multilist with search) and the Experience Forms application listing directly relies on the index to show the list of created forms. Instead, create a custom index and update those settings as required.
Option 1: You can set include or exclude items based on template type in index configuration file.
Option 2: Add a field in base template like "DoNotIndex" to filter or limit your search result.
Option 3: Create a new index and in configuration set very specific node require to be indexed. For example "< Root>/sitecore/Home/MyNode< /Root>"