Install a Search Client in Salesforce Communities (Visualforce)

This article shows how to set up the SearchUnify search in a Visualforce community. The installation takes only a few minutes but goes a long way in enhancing user experience.

Salesforce Default Permissions

Search clients on your org adhere to default Salesforce positions, which means that a Guest User cannot see any cases on the search results page and a Partner can see all the cases concerning his or her Contacts. The table summarizes the default permissions followed on the Salesforce search client.

Permissions Chart

Object User Type User can see
Cases Internal All the cases in an org.
Partner All the cases that belong to the Partner's account.
Guest User No cases are visible.
Customer

All the cases that belong to the Customer's contacts.

     
Articles Internal All the articles in Knowledge.
Partner All the Public articles and the articles visible to the Partner.
Guest User All the Public articles.
Customer All the Public articles and all the articles visible to the Customer.
     
Group Feed Internal All feeds of all the groups.
External All feeds of the groups of which the user is a member and all feeds from public groups.
All All feeds of all the groups.
Guest All feeds from public groups.
     
User Feed Internal All feeds of all the users.
External All feeds of all the users.

Create a Salesforce Visualforce Search Client

  1. Ensure that Salesforce Communities are enabled. Skip this step if you already have a community.
  2. Create a Salesforce Visualforce search client.
  3. Configure the Salesforce Visualforce search client.

Install SearchUnify Package

  1. Visit Salesforce AppExchange, look up "searchunify", and open the top listing, SearchUnify - Cognitive Search & Insights for Salesforce.

  2. Click Get It Now.

  3. If prompted, log in with your Salesforce admin credentials.

  4. It's usually a good practice to install an app on Sandbox, instead of Production.

  5. Install the app for All Users. A warning might come up. Overlook it and proceed with installation.

In the end an Installation Successful message will greet you.

Connect Salesforce Org with SearchUnify Instance

The data flow between SearchUnify and your Salesforce org is managed through Remote Sites, of which two must be created before package processing. For instructions, check out Create Remote Sites in Salesforce.

Process SearchUnify Package

  1. Click Salesforce App Launcher and then View All.

  2. Find SearchUnify Configuration and click it open.

  3. Create a remote site using URL on the Search Configuration screen.

    1. Select Visualforce from Choose Search Platform. A configurations page will appear. Enter the details and click Process.
      1. Select your community for configuration. Choose a Salesforce community where the search client will be installed. In the image, the community chosen is "Aniruddha".
      2. Enter Service Endpoint. It is your SearchUnify instance URL. You can find it in the readme file.
      3. Enter Provision Key. Get it from your SearchUnify representative.
      4. Enter UID. It is the ID of the downloaded search client.
      5. Enter community page name (Optional). Select or create a page with full-width and only one column. The page name should be limited to lowercase letters and hyphens. Spaces are not allowed. In the image, the page name is "searchunifysearchpage".
      6. Enter Expiration Time. Write a number between 1 and 120.

You have configured the search successfully. means that SearchUnify has been installed on your VF community.

Add SearchUnify Instance to CSP Trusted Sites

  1. From Setup, go to Quick Find Box, find CSP Trusted Sites, and open it.

  2. Click New Trusted Site.

  3. In the form that opens, enter "SearchUnify" in Trusted Site Name and {{instance URL}} in Trusted Site URL.

  4. Check all the CSP Directives and click Save.

Set up on Community Homepage

  1. If you are on Classic, then from Setup, go to Quick Find Box, look up "Sites" and open Sites in Build > Develop; as is shown in the next image. The path for Lightening users, from the search box, is User Interface > Sites and Domains > Sites.

  2. Scroll down to find your community and open it.

  3. Click {{Home Page Name}} against Active Site Home Page. In the image, the home page name is "CommunitiesLanding".

  4. Click Edit.

  5. There are two ways to set up search on the community:
    1. Type I. Both the search box and search results are right on the home page. The illustration used in this article is Type I. To proceed with Type I, edit the existing code and insert <su_vf_console:SU_Vf_Community_Component /> on the page. The final code looks as in the image.
    2. Type II. The search box is on the home page but the results are displayed on a community page specifically created to host them. If you are going with Type II, then name the page in Enter community page name (Step 4 of Process SearchUnify Package). To proceed with Type II, edit the existing code and insert <su_vf_console:SU_Vf_Community_Searchbox /> on the page. The final code looks as in the image.
    After selecting a Type, click Save.

  6. Scroll down to Site Visualforce Pages and click Edit.

  7. Add su_vf_console.SU_Vf_Community to Enabled Visualforce Pages, and click Save. IMPORTANT. If you are not hosting the search box on the home page (Type 2 in step 5), then add the search page (Enter community page name in step 4 of Process SearchUnify Package) to Enabled Visualforce Pages as well.

  8. From Sites (step 1), click the Site URL of your community to view SearchUnify search client on its home page.

Result

The search results update when you click anywhere outside the search box, even when you are still typing.

Install a Search Client in Salesforce Communities (Visualforce)

Last updatedFriday, June 10, 2022

Was this article helpful? Send us your review at help-feedback@searchunify.com