How to store the Search Index in the Custom Object itself

Last published at: 2022-12-02 13:28:20 UTC

When using Custom Objects and the Search Index feature, an additional field is required in order to store the Search Index in the Object record Itself. This tutorial will show you how to create that field.


By default, the search index is stored in the Index Object: when you create a Search Index, the indexes are stored in a custom object called "Index Object".
Each record that is indexed takes 2kb of storage space.

Another option is to store the index in the Object itself. This will store the index in a field in your record, which takes no additional storage space. As a result of updating the record, the last modified date of all records will change. 

These settings can be changed in DC Setup > *Object*(Leads, Contacts, etc.) > *Object* Settings > toggle Advanced Settings > Index Location

To store the Search Index for a Custom Object in the Object record itself:

1. Create the Search Index field in your Custom Object

  1. Go to Salesforce Setup.
  2. Open the Object Manager.
  3. Find and select the Custom Object to which you want to add the Search Index field. 
  4. Click on Fields & Relationships.
  5. Click New to create a new field.
  6. In Step 1, choose Text Area (Long) and then click Next.
  7. In Step 2, fill only the following fields and then click Next:
    Field Label: Duplicate Check Index
    Field Name: dc3Index
  8. Depending on your Salesforce edition (Professional and up), you will now get a screen to establish field-level security. Decide who may see the Duplicate Check Index field and click Next
  9. Depending on your Salesforce edition (Professional and up), you will now get a screen where you are able to add the Duplicate Check Index field to the page layout. Add the field to the pages you would like. Click Save.

Click here to watch a short video showing all the steps.

The Search Index field has been created for your Custom Object. Now continue with the tutorial to learn how to enable and create a Search Index.

2. Enable and create the Search Index for your Custom Object

In this tutorial, the Opportunity Object is used as an example. This tutorial works with any other Custom Object.

  1. Go to DC Setup.
  2. On the left-hand side, select your Custom Object, in this example the Opportunity Object.
  3. Go to the *Object* Settings tab, so in this case Opportunity Settings.
  4. Make sure the Search Index setting is enabled.
  5. At the right, toggle the Show Advanced Settings option.
  6. Scroll down to the Index section.
  7. At Index Location choose Opportunity Object -- Duplicate Check Index or the equal for your custom object.
  8. Go to the Index Batch tab. 
  9. Click Start and select Create Search Index.

Once the search index is created, you can start searching for duplicates within your Custom Object. The time it takes to create the search index depends on your Object record count. The Search Index will update automatically for all new and modified records. 

Click here to see a short video of step 2.9.