Specify Recommended Results

What are Recommended Results?

Recommended results enable you to filter your search results according to the parameters that you specify. These parameters can include:

  • Recently viewed
  • Most used by me
  • What others are viewing
  • New results
  • Curated results

How to Configure your Recommended Results with the UI Editor

The Recommended Results component is embedded in the Analytics Settings module. You can modify your HTML page's settings through the UI Editor to enable the Recommended Results component for your desired page.

Procedure:

  1. SmartHub administrators can simply click the UI Editor link from the SmartHub Administration page.

  2. Select your results page.

    1. Below, the Results.html page is shown for sample purposes.

    2. Upland BA Insight recommends you create a custom page and folder to modify. Leave the default files as templates.

      1. For example, Customizations/Results.html. The default Results.html page is located under the top most SmartHub directory. For more information, see Creating Custom Pages.

  3. Select the Advanced mode from the top right of the page.

  4. Select Advanced settings edit.

  5. Scroll down to line 148 (this may vary), which contains the text SH.AnalyticsSettings.CustomSettings

  6. To access the available Recommended Results settings, click the See Default Settings link in the top right corner.

  7. A new browser tab opens with all available SmartHub module settings.

  8. Search for the word "recommendedResultsControl" on the page to quickly navigate to the Recommended Results default settings, nested under the AnalyticsSettings component shown below:
  9. SH.AnalyticsSettings = SH.AnalyticsSettings || {};
    SH.AnalyticsSettings.DefaultSettings = {
        Enabled: true,
        PAXModules: "PAX_PortalModule,PAX_SearchModule,PAX_UserProfileModule,PAX_VisualRefinersModule,PAX_SmartPreviewsModule,PAX_Ratings,PAX_ChatBotModule,PAX_SmartAutomationsModule",
        customProperties: "",
        showTrackingBehaviorControl: true,
        enableGeolocationTracking: true,
        artifactPushInterval: 60, //seconds
        visitsDuration: 30, //minutes
        geolocationTrackingMessage: "We would like to know your location in order to improve your search experience.".toLocaleString(),
        trackingBehaviorPropertyName: "BAISmartHubAnalyticsTrackingBehavior",
        defaultTrackingBehavior: "0", // 0 - Track; 1 - Do not track; 2 - Track but hide identity
        trackingControlFile: "client/pax-tracking-behavior-control", // must have the format used by require.js
        recommendedResultsControl: {
            showRecommendedResultsDropdown: false,
            enableRecommendedResultsControl: true,
            title: "Filter results by".toLocaleString(),
            messageNotFoundRecommededResults: "Could not find any results for option: ".toLocaleString(),
            items: {
                "Default": {
                    value: "0",
                    label: "Default".toLocaleString()
                },
                "RecentlyViewed": {
                    value: "1",
                    label: "Recently viewed".toLocaleString(),
                    lastDays: "5",
                    maxResults: "100"
                },
                "MostUsedByMe": {
                    value: "2",
                    label: "Most used by me".toLocaleString(),
                    lastDays: "5",
                    maxResults: "100"
                },
                "WhatOthersAreViewing": {
                    value: "3",
                    label: "What others are viewing".toLocaleString(),
                    lastDays: "5",
                    maxResults: "100"
                },
                "NewResults": {
                    value: "4",
                    label: "New results".toLocaleString(),
                    lastDays: "5",
                    maxResults: "100"
                },
                "CuratedResults": {
                    value: "5",
                    label: "Curated results".toLocaleString(),
                    lastDays: "5",
                    maxResults: "100",
                    "SmartAnalyticsIndex.[AccountName]": "AdditionalProperty.[AccountName]"
                }
            },
            parentSelector: ".sh-main-results-container" // JQuery selector for parent element(s) where to inject the control.
        },
        UserProfileMappings: {
            "PreferredName": "User".toLocaleString(),
            "AccountName": "AccountName".toLocaleString(),
            "Department": "Department".toLocaleString(),
            "Office": "Office".toLocaleString(),
            "SPS-JobTitle": "JobTitle".toLocaleString(),
            "Title": "Title".toLocaleString(),
            "SPS-Location": "UserLocation".toLocaleString(),
            "SPS-Birthday": "Birthday".toLocaleString(),
            "SPS-TimeZone": "TimeZone".toLocaleString(),
            "Manager": "Manager".toLocaleString(),
            "SPS-Skills": "Skills".toLocaleString(),
            "SPS-HireDate": "HireDate".toLocaleString(),
            "YearsWithCompany": "YearsWithCompany".toLocaleString()
        },
        enableCaseSensitivity: "false",
        logLevel: "WARN"
    }
  10. Copy the entire recommendedResultsControl section.
  11. Go back to your Advanced settings edit tab.
  12. Paste the copied settings inside section SH.AnalyticsSettings.CustomSettings.
  13. Set the showRecommendedResultsDropdown setting to true and change the parentSelector setting to use a JQuery selector for the parent element where you are injecting the control.

  14. Modify any additional settings as desired.
  15. Click Save changes.
  16. Click the link Preview <html> file.html at the top of the code editor.

  17. Review your HTML page in the new tab that opens.

  18. Make any necessary changes back in the code editor. Repeat steps 14-18 as necessary.

  19. Click Save changes.

How to Disable Recommended Results

From within the settings inside section SH.AnalyticsSettings.CustomSettings.

  1. By default, the following two parameters are set to false and true, respectively:
    1. showRecommendedResultsDropdown
    2. enableRecommendedResultsControl


  2. Set both parameters to false to disable this feature.

How to Modify or Filter the Recommended Results Display

Procedure:

  1. Follow steps 1-9 under the UI Editor topic, above to access the Recommended Results settings.

  2. The Recommended Results items are stored 5 lines under the recommendedResultsControl: { line in the settings file:

  1. Copy the settings nested under the items: { line.

  2. Paste the copied settings inside section SH.AnalyticsSettings.CustomSettings.
  3. Modify additional settings as desired. Use the tables below in the topic "Recommended Results Display Settings."
  4. Click Save changes.
  5. Click the link Preview <html> file.html at the top of the code editor.

  6. Review your HTML page in the new tab that opens.

  7. Make any necessary changes back in the code editor. Repeat steps 5-8 as necessary.

  8. Click Save changes.

Recommended Results Display Settings

Use the following options to modify, or add a filter to, the Recommended Results display:

Option (Value: number used for the “Filter results” drop-down) Description
Recently viewed (value: "1") Displays the results (Max Results) opened in the lastDays.
Most used by me (value: "2") Displays the top (Max Results) results opened by me in the lastDays.
What others are viewing (value: "3") Displays the top (Max Results) results opened by other users in the lastDays.
New results (value: "4") Displays the top (Max Results) results opened by other users in the lastDay and the documents that have been modified in the last week.
Curated results (value: "5") Displays the top (Max Results) results opened by users in the same department

Parameters

Use the following parameters:

Parameter Description
value This the OptionId from the Recommended Results Configuration JSON.

label

This is the display name of the filter.
lastDays This determines how recent the results are.
maxResults This is the maximum number of results.

How to Add a New Filter

To add a new filter, add a new item in the items array and specify your parameters.

See the following example:

{ value: "value_example", label: "title_example", lastDays: "lastDays_example", maxResults: "maxResults_example" },

Custom Recommended Results

If you need a custom recommended results on your page, use the following procedure.

  1. Navigate to the SmartHub administration portal. For example, http(s)://[SmartHub-url]/_admin

  2. Click Analytics Settings from the left panel.      
  3. Add a new recommended result, using the format from the below example, in the Recommended Results Configuration Json setting. For example, if you use ID 100:

    Analytics config file: Recommended Results block
    {
        "OptionId": "100",
        "QueryTemplate": {
            <your custom query to Elastic goes here, it can use lastDays and any other custom parameter as needed> },
            "QueryTransformation": "(%ORIGINALQUERY%) AND (%RECOMMENDEDITEMS%)"
    }
  4. In your custom HTML page settings, add a new item in the items array and specify your parameters such as shown below.

    Note that Value settings maps to Option ID.
    recommendedResultsControl:{
        items:{
            “myCustomResults”: {
                Value: ”100”,
                Lastdays: ”10”,
                maxResults: ”10”,
                customParam: ”customparamvalue”
            }
        }
    }
  5. Finally, add Content-by-Search content container to your page. For more information, see Create a New Content Container.
    1. When creating your content container, select Content By Search in the ContentContainer Type field.

    2. In the content container parameters, you must append {SA.RecommendedResults.100} to the QueryTemplate parameter. Refer to the follow code snippet as an example: QueryTemplate:{searchboxquery} federatorBackends:\"*\"{SA.RecommendedResults.100}