Tailor Global Search to Your Experience Builder Site

Learning Objectives

After completing this unit, you’ll be able to:
  • Make more content searchable across your site.
  • Set up the Search Results page.
  • Learn about autocomplete.

Create an Experience Builder Site: A Refresher

Let's get started by turning on Digital Experiences in your Trailhead Playground. Next, we’ll create an Experience Builder site for the company Capricorn Coffee. You can use this site to follow along as we tour the features of search. Remember, the site you create in your Trailhead Playground is not automatically populated with content. So, you won't see search results like those shown throughout this module. The search results are examples.


Once you enable Digital Experiences, you can't turn this feature off.

To enable Digital Experiences:
  1. From Setup, in the Quick Find box, enter Digital Experiences then select Settings.
  2. Select Enable Digital Experiences.
  3. What you do next depends on whether enhanced domains are enabled.
    • If enhanced domains are enabled in your org, your digital experiences domain is shown. It includes your My Domain name in the format MyDomainName.my.site.com for production orgs.
    • If enhanced domains aren’t enabled in your org, select a domain name, and click Check Availability to make sure that it’s not already in use. We suggest that you use a name recognizable to your users, such as your company name. The domain name is the same for all experiences. To create a unique URL for each experience, you can enter a unique name at the end of the URL. For example, if your domain name is UniversalTelco.force.com and you’re creating a customer community, enter customers to create the unique URL UniversalTelco.force.com/customers.

You can’t change the domain name after you save it.

You can designate a custom domain by entering it in on the Domain Management page. From Setup, in the Quick Find box, enter Domains then select Domains.

After you enable digital experiences, you are redirected to the All Sites page in Setup. If not, enter All Sites in the Quick Find box, and select that option.

To create a new site:

  1. From the All Sites page, click New.
  2. From the Service page, select the Customer Service template.
  3. Click Get Started.
  4. For Name, enter Capricorn Cafe.
  5. If you’re asked for a URL, enter capricorncafe or another URL that’s not used for an existing site in your org.
  6. Click Create.

Take a quick look around. This is Experience Workspaces, where you have easy access to the Experience Builder and Dashboards, which we visit later.

Make Global Search Even More Global

If your search results are limited to Articles and Discussions, you might be using an older component, called Search Results. It’s fine if you want to stick with that, but there are a few reasons to switch to the newer component, called Global Search Results. With it, you can:

  • Make almost any object from your Salesforce org searchable in the site, including custom objects. You can even get results from external sources like Wikipedia. We talk more about external sources in the next unit.
  • Turn on search results filtering, so users can refine their results and find exactly what they need.
  • Add a search results overview page, called the All results tab, that lets users see a quick view of their best matches.

If that sounds like stuff your users would be excited about, read on. If you’re already using the Global Search Results component but want a refresher on its features, the rest of this section is for you as well.

To find your site's search results component, head to the Experience Builder, open the Search template page, and select the component.

  1. Select one of the following ways to get to the Experience Builder.
    If you created a new site using the previous steps, you’re in Experience Workspaces. Click the Builder tile. Experience Workspaces, with the Builder tile highlightedIf you're a Community Manager who is logged in to the site, select Experience Builder from your profile header. From the profile header, select Experience Builder
    If you're a Salesforce administrators, go to Setup, and in the Quick Find box, enter All Sites. Select the Builder link for the appropriate site. Click Builder next to a site name to edit the site
  2. Click Home in the top navigation bar to see the Pages menu. In the Pages menu, enter Search in the search box then select Search from the list. In the Pages menu, type Search in the Find a page box; then select Search under Template Pages

  3. On the Search page, hover the cursor over the search results section. A blue border appears, and you can see the component name at the top. Click the component name to open it.
The component name appears when you hover over its section of the page

If the component name says Search Results, it's easy to switch to the Global Search Results component:

  1. Click the X on the Search Results component to remove the component from the page.
  2. To add the Global Search Results component, click to open the Components panel. Drag the Global Search Results component onto an editable area of the page.
  3. Click Publish in the site header to save your changes.

By default, the Global Search Results component shows results for Articles (if Knowledge is enabled), Discussions, Cases (for Service Cloud users), and Groups. But it’s easy to add any other object that’s searchable in Lightning Experience and supported in the Customer Service template. To learn which objects those are, check out the article in the Resources section called Which Experience Cloud Template Should I Use? You can make a custom object searchable, too, by creating a custom tab for the object in your Salesforce org.

The Global Search Results component, with the default list of objects: Discussions, Articles, Cases, and Groups

Let's say you want site members to be able to search for PDFs and other files:

  1. At the bottom of the Global Search Results component, click Add. The first object from the list of available objects is added.
  2. To change it, click the object name to open its properties. In the Object dropdown, choose Files then click Save.The Global Search Results component, with the Edit Tab Properties open for the newly added object

After adding all the objects you want to be searchable, keep the Global Search Results component open to adjust how the objects appear in search results.

Search Results, Just the Way Your Customers Like Them

You might’ve noticed that you can drag and drop objects in the Global Search Results component to change their order. That’s the order that objects appear on the search results page. So if your site is strong on a certain type of information, like Articles, consider putting that object at the top.

You probably also noticed the two checkboxes:

  • Show the All results tab
  • Allow search result filtering

The All results tab gives your site members a place to see the top results for every object on one page. When users aren’t sure whether their answer is in a Discussion, an Article, or a File, seeing this overview can be a time-saver.

The All results tab, showing search results for Discussions, Articles, Topics, Files, Groups, and Wikipedia.

To see all results for an object, click the object name or View More.

If you select Allow search results filtering, your members can narrow search results by selecting a supported object on the left side of the search results page and then applying filters.

Filtering options for Articles on the search results page

Search filtering for sites is on by default in your Salesforce org. From Setup, in the Object Manager, go to Search Layouts for each object you want to filter. To the layout, add the fields that users want to filter. Supported field types are checkbox, phone number, picklist, text, and URL. You can’t filter encrypted fields.

If you have search results for Discussions, you can also decide how much information to show for each match. Capricorn Coffee selected “Show search results for all feeds, including questions, posts, and comments” to give its site members as many matches as possible for their search terms.

The Edit tab for Discussions, with a checkbox to make search results publicly available and a checkbox to show search results from all feeds, including questions, posts, and comments

If you don’t check this box, only questions and answers that have topics are searched. Site members don’t see matches in Groups, feeds on records, or feeds on user profiles.

Something to consider when making your decision: When you check this box, the search results page also shows more information for each matching discussion.

Here are Capricorn’s Discussion search results with the box checked. Each result shows the title and text of the post, and the topics assigned to the post. This expanded format makes it easier for members to scan complete posts for information.

Expanded search results for Discussions; each result shows the title and text of the post, and the topics assigned to the post

Here’s what Capricorn’s Discussion search results look like without the box checked. Note that the results don’t include any text from the post. This compact feed makes it easier to scan titles of posts.

Compact search results for Discussions; each result shows the title of the post, the author of the post, and the topics assigned to the post

If it’s more important for your site that Discussion results are compact, leave this box unchecked.

To see how great your new search results page looks, enter a test word in the Search Term field of Global Search Results component, then press Enter. (If you’re following along in a new Trailhead Playground, you might not see many—or any—search results for this test.)

The Global Search Results component, with the Search Term field highlighted

When you’re satisfied with how your search results look, click Publish in the site header.

All About Autocomplete

Let’s talk about what happens before your site members get to the search results page. In Experience Builder sites, they can also get search results as they type in the search box.

Search results appear below the search box as you type your search term

Meet the Global Search for Peer-to-Peer Communities component, where you can set up a feature called autocomplete. When site members start typing their search terms in the search box, autocomplete suggests matching articles, discussions, and more. It’s kind of like having a friend who finishes your sentences for you—in a helpful way. It helps users get to what they’re looking for faster.


The Global Search box also supports autocomplete, but it's optimized for sites that don’t use Chatter and want to focus their searches on articles, topics, and other types of Salesforce records. Because most customer service sites use Chatter, this module focuses on the Global Search for Peer-to-Peer Communities component.

The Global Search for Peer-to-Peer Communities component is in the Experience Builder. To open it, hover the cursor over the search box at the top of the page and click when the blue border appears. To get started, expand the Autocomplete Search section.

The search box highlighted in blue, and the Global Search for Peer-to-Peer Communities component open

As you can see, there’s a lot here about autocomplete. Let’s go through it step by step.

  1. To turn on autocomplete, select the Use autocomplete in searches checkbox. It might even already be checked. Nice work!
  2. For the rest of the settings, let’s simplify things. Let’s talk about what Capricorn Cafe set up for its site. Think of it as ordering the Barista’s Special.
    • Maximum Autocomplete Results: Capricorn kept the default of 6 results showing as the user types in the search box. Too many results can be overwhelming, and with the most relevant ones at the top, there’s no need to go too wild here.
    • Limit Autocomplete Search Results to Discussions and Articles: Capricorn wants its members to see results for more objects than Discussions and Articles, so this option is left unchecked.
    • Objects in Autocomplete Results: Just like Capricorn added the Files object to the Global Search Results component, it added Files here, too.
The Global Search for Peer-to-Peer Communities component, with the Result Properties open for the newly added object

That’s it! It’s easy like a Sunday morning drip coffee.

You might wonder how we determine which autocomplete results are most relevant. We put Articles and Discussions at the top of the list, and we pay attention to how many views and likes an article has. We also see whether any site members choose an answer as a best answer or give it a thumbs-up rating. The rest of the results are ordered based on factors we discussed in the last unit.

Next, we discuss some additional search features you can set up in your site.

Keep learning for
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities