When to use index grouping for the search index

Last published at: December 2nd, 2022
Delete

Please only use this feature when the Support team indicated this would be very useful.

When the index search is not returning the records you expect it to return, and you have already maximized the 'records returned on index search' settings, it can be useful to implement index grouping. 

When a search is executed within Salesforce for possible candidates this is done with the OR principle by default. So when you have a scenario with FirstName, LastName and Company the search will look like this. 

LASTNAME OR FIRSTNAME OR COMPANY

This means that any record which matches with one of these values will return in the index search. You can imagine when you have a large salesforce organization this could lead to congestion within your search results.

By applying index grouping this can be overcome. If you create a group which contains FirstName and LastName and a second group containing LastName & Company the search will look like this. 

(LASTNAME AND FIRSTNAME) OR (LASTNAME AND COMPANY)

This will result in records where the LastName and FirstName are similar or where the LastName and Company are similar. 

How to use index grouping

Step 1 Enable Index Grouping

Go to DC Setup -> General -> Settings and find the 'Enable options to group the index search.' and enable it.

Step 2 Create Groups for all scenarios

Because index grouping is enabled for all objects and all scenarios this setting needs to be implemented for all scenarios. By default all fields within a scenario will get a separate group. This will ensure the search keeps working after enabling the setting. 

Open each scenario and define a logical grouping. Best practice is to not add more than three fields within a group.
A field can be used in multiple groups.