📢 Attention Salesforce Certified Trailblazers! Maintain your credentials and link your Trailhead and Webassessor accounts by April 19th. Learn more.
close

Tailor Global Search to Your Community

Learning Objectives

After completing this unit, you’ll be able to:
  • Make more content searchable in your community.
  • Set up the Search Results page.
  • Configure autocomplete in the Search & Post Publisher.

Creating a Community: A Refresher

Let's get started by turning on communities in your Trailhead Playground, if you haven’t already. Then we’ll create a community for Capricorn Coffee that you can use to follow along as we tour the features of community search.

Note: Once you enable Communities, you can't turn it off.

  1. From Setup, enter Communities Settings in Quick Find, then select Communities Settings.
  2. Select Enable Communities.
  3. Enter a unique value to be used as your domain name and click Check Availability. (Note: Keep in mind that you can't change the domain name after you save it. You have to call Salesforce to change it.)
  4. Click Save.
  5. Click OK.

You should have been redirected to the All Communities page in Setup, but if not, enter All Communities in Quick Find, and select All Communities.

  1. Click New Community.
  2. 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 community in your org.
  6. Click Create.

Take a quick look around. This is Community Workspaces, where you have easy access to the Community 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 for search results, 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 community, 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 community’s search results component, head to the Community Builder, open the Search template page, and click on the component.

  1. There are a few ways to get to the Community Builder.
    • If you created a new community using the steps above, you’re in Community Workspaces. Click the Builder tile.
      Community Workspaces, with the Builder tile highlighted
    • Community managers can select Community Builder from their profile header when they’re logged in to the community.
      From the profile header, select Community Builder
    • Salesforce administrators can reach the Community Builder from Setup. Enter All Communities in the Quick Find box, then select the Builder link for the appropriate community.
      Click Builder next to a community name to edit the community
  2. In the Pages menu, type Search in the Find a page box. Then select Search under Template Pages.
    In the Pages menu, type Search in the Find a page box; then select Search under Template Pages
  3. Hover the cursor over the search results section of the page. A blue border appears, and you can see the component name at the top. Click to open the component.
The component name appears when you hover over its section of the page
Note

Note

If it 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 Components panel icon to open the Components panel. Drag the Global Search Results component onto an editable area of the page.
  3. Click Publish in the community 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 Napili template. (To see which objects those are, check out the article in the Resources section called Compare Features Available in Community Templates.) 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

Say you want community 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. Then, in the Object dropdown, choose Files.
    The Global Search Results component, with the Edit Tab Properties open for the newly added object
  3. Click Save.

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 community 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 community 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 community 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 communities 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. Add the fields that users want to filter to the Search Results layout. 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 community 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. Community 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 community 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 community header.

All About Autocomplete

Let’s back up a tiny bit and talk about what happens even before your community members get to the search results page. In communities, 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

We invite you to meet the Global Search for Peer-to-Peer Communities component, where you can set up a feature called autocomplete. When community 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.

Note

Note

There are two other autocomplete components available in communities. The Search & Post Publisher is an older version that we talk more about below.

Another component, called the Global Search Box, is optimized for communities that don’t use Chatter and want to focus their searches on articles, topics, and other types of Salesforce records. Because most customer service communities use Chatter, we’re focusing on the Global Search for Peer-to-Peer Communities component in this module.

The Global Search for Peer-to-Peer Communities component is in the Community 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.

The first checkbox is easy: Use it to turn on autocomplete. It might even already be checked. Nice work!

For the rest, let’s simplify things. Let’s talk about what Capricorn Coffee did for its community. Think of it as ordering the Barista’s Special.

Maximum Autocomplete Results
Decide how many results you want to appear as the user types. Capricorn kept the default of 6. 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 community members to see results for other objects, too, so this was left unchecked.
Objects in Autocomplete Results
Just like it added Files to the Global Search Results component, Capricorn 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.

If your community uses the Search & Post Publisher component, you have two options.

  1. Upgrade to the Winter ’18 Napili template, which uses the Global Search for Peer-to-Peer Communities component. Keep in mind that the new template includes other changes that you may want to consider before updating.
  2. Keep reading to set up the Search & Post Publisher according to best practices.

To set up the Search & Post Publisher, go to the Builder and click the search box.

The search box highlighted in blue, and the Search & Post Publisher component open

Check the box to use autocomplete in searches. Then:

Show Autocomplete Results in One List (1)
Check this box so your community members see all the matches for their search terms in one place. Mousing around to different tabs is more work, and can be difficult for community members with limited mobility.
Result Sorting (2)
Sort by Relevance. This setting has more to it than meets the eye. Not only does it put the most relevant results at the top of the list, it also allows you to add more objects to autocomplete. By contrast, the Group by Object option limits autocomplete results to Articles and Discussions.
Maximum Autocomplete Results (3)
We suggest using no more than 10.
Autocomplete Results (4)
Sort by Relevance. Here’s where you can add objects to be searched by autocomplete. Click Add, then click the new object to change it in the Result Properties. Click Save, and you’re good to go.
Changing the newly added object to the Files object in the Result Properties

You might wonder how we determine which autocomplete results are most relevant. We put Discussions and Articles at the top of the list, and we pay attention to how many views and likes an article has, and whether any community members chose an answer as a best answer or gave it a thumbs-up rating.

The rest of the results are ordered based on factors we discussed in the last unit.

When you’re finished editing in the Search & Post Publisher, click Publish in the community header.

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

retargeting