Configure Service Portal search

Service Portal 9.52 provides an out-of-box new IDOL database named SearchHistory to store the suggest search results data. IDOL collects data in the SearchHistory database from the following ways:

  • A series of suggested search terms in the searchHistory.json file as initially defined by the system administrator.
  • The accumulating data from end users' inputs, which may cover the following sample scenarios:
    • When an end user searches for how to setup Lync meeting and there are search results returned from KB articles, Catalog items, Request items and so on, the system indexes how to setup lync meeting to the SearchHistory database. This indexing operation only happens once per hour or the terms in cache exceeds the maximum cache size of 10000.
    • If another user also searches for how to setup Lync meeting, both the userIds property and the searchCount property in the how to setup Lync meeting record will increase by 1.
    • If three or more than three different users search for how to setup Lync meeting (which means userIds>=3 and searchCount>=3 in the how to setup Lync meeting record), the system displays how to setup Lync meeting as a suggested search term when the fourth user types how in the Search Service Portal text box.

    Therefore, the data in the SearchHistory database populates and the suggest search results user experience gets better.

However, after you have successfully installed Service Portal, the SearchHistory database is null and the system will not suggest any search results when an end user types a few characters in the Search Service Portal text box. The system administrator must import the initial search history data to SearchHistory so that the system will search the SearchHistory database to retrieve terms that match the user's input and then lists them out as suggest search results.

Follow these steps to import the initial search history data to IDOL:

  1. Log in to the Red Hat system as the root user by using the command line.
  2. Create the searchHistory.json file and then define the suggested search terms in this file. Administrators must make sure that these terms have results returned from search.

    Refer to the following example for the content and structure for searchHistory.json:

    [
        {
            "query" : "Mobile App",
            "searchCount" : 4,
            "serviceDbs" : [
                "Article",
                "Support"
            ],
            "tenant" : "CONSUMER",
            "userIds": ["orgadmin","consumer","admin"]
        }
    ,
        {
            "query" : "Email Service",
            "searchCount" : 9,
            "serviceDbs" : [
                "Support",
                " Services "
            ],
            "tenant" : "CONSUMER",
            "userIds": ["orgadmin","consumer","admin"]
        }
    ]
    

    Note If an end user's input is not covered by the initial search history data, the system will not provide any suggest search results.

  3. Run the following command to import the initial search history data to IDOL:

    java -jar lib/search.jar importSearchHistory ./search.yml ./searchHistory.json