Sitefinity - Adding custom fields to search index

July 31, 2012 Digital Experience

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.

  1. 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.
  2. 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).
  3. 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

 

Video demonstrating how to add a custom field to the Sitefinity search index

The Progress Team