When to exclude a field from the Search Index

Last published at: December 2nd, 2022
Delete

You can exclude fields from being taken into account in the Search Index. Learn more about when to exclude a field from the Search Index in this article.

Search Index

Duplicate Check uses the Search Index to find potential duplicate records in Salesforce. This Search Index is a string of values and numbers which is created based on the scenario that you use. 

When we search with the Search Index, potential duplicates are returned. By default, we return about 15 records. As a next step, the scenario calculates matching percentages for those 15 records. Every pair with matching percentages that are equal to, or higher than the defined threshold level, are defined as duplicate records and returned in the UI. 

When to exclude a field from the Search Index?

In a Salesforce environment with a lot of records, it's important that a search for duplicates is done using a Search Index that is as unique as possible. If searching is done with values that can be found in a lot of records, it's possible that the right duplicate record is not part of the 15 records that are returned.

We can, therefore, help Duplicate Check by not taking into account fields with values that can be common in a lot of records. By excluding them only from the Search Index, but not from the process of calculating a matching percentage, it's easier to find duplicate records in environments with a large data volume.

To exclude fields from the search index, first enable the option to do so, then indicate which fields should be excluded.

Enable the option to exclude fields from the Search Index

  1. Go to DC Setup.
  2. On the left-hand side, under General Setup, click Settings.
  3. Scroll down to the Search Index section.
  4. Toggle Enable the option to exclude fields from being taken into account in the search index.

Exclude a field in a scenario

  1. Still in DC Setup, on the left-hand side, under Object Setup, select the Object you want to configure this for. 
  2. Fold open the scenario you want to edit.
  3. In the Do Not Index column, pick the fields you want to exclude from the Search Index, and switch the toggle to set it to "true".
    Note that the "Do Not Index" column is only visible when the Search Index is enabled on tab *Object* Settings
  4. After making changes to your scenario, make sure to re-run the Search Index on tab Index Batch.

In this scenario, the Country field will not be indexed

Delete

In the example above, the 'Country' field was excluded from the Search Index. This could make sense because a lot of records can have the same value in this field. By excluding it from the Search Index, the field is not used when searching for potential duplicates, but it is used when calculating a matching percentage.