In Sitefinity 5.1, custom fields can now be easily added to a Sitefinity search index. No-longer do you need to use pipes and custom programming to include custom fields.
How it works
The properties for the search results widget and search index now contain a field whereby you add the name of your custom field to include in the search index and results.
Getting Started
Follow the steps below. Note these steps assume you have already created custom fields and data inside of these fields.
- In the Sitefinity backend, edit the page which has the search results widget then edit the properties of this widget. Click on the “Advanced” button at the bottom of the page. Scroll down in the advanced settings and find the field called SearchFields. Add the name of your custom field and click Save. Note, multiple fields can be added and must be separate by a comma.
- In the Sitefinity Backend, click on Administration in the top navigation, then select Search and Indexes. This will show you all of the indexes you have created for your site. Click on the name of the index you want to add your custom field. At the bottom is a new field called Advanced. Add the name of your custom field to the Advanced box and click “Save Changes”. You can manually include different fields (static or dynamic) in the search index. Note that these fields should be of type short or long text, separated with a comma (Ex: Author, SourceName).
- Re-index your search index by clicking on Actions and Reindex.
The data in your custom fields should now be included in the Sitefinity Search Index Catalog. This method works for all custom fields including custom fields for ecommerce product types. In the video below, I demonstrate how to add custom fields to Sitefinity Ecommerce Product Types and include these into the existing search index.
Additional Links and Documentation
-
Forum post on Search Index Fields for Module Builder Modules
-
Video showing how to add custom modules fields to search index