Sitecore Experience Accelerator (SXA) Tips and Tricks: Part-3
How to include custom template based item in Sitecore Experience Accelerator (SXA) Search results?
How to add fields from custom template into search index fields int Sitecore Experience Accelerator (SXA) search box to check for matches?
How to include custom template based item in Sitecore Experience Accelerator (SXA) Search results?
How to add fields from custom template into search index fields int Sitecore Experience Accelerator (SXA) search box to check for matches?
The Sitecore Experience Accelerator (SXA) by default index the Page items and only those results will come into search results. Sometimes, we are creating custom templates like Articles, News, etc. in our sites and when user try to search and these items are not coming into search results.
To include items which created using our custom templates into search results, we have to inherit our custom templates with _Searchable template ( /sitecore/Templates/Foundation/Experience Accelerator/Search/Computed Fields/_Searchable).
After inheriting custom template with _Searchable template, now go to settings > scopes and create new scope and using build query option, verify your items coming into search results or not.
Now, fields from your custom templates, which inherited from _Searchable template should be used by SXA search box to check for matches.