Funnelback for higher education results page configuration - search box and auto-completion

This guide applies to the Squiz Experience Cloud version of Funnelback for higher education. See the v15.x Funnelback for higher education documentation for earlier releases.

The search box has become an iconic symbol for search in general and is the go-to place for users when attempting to find answers to their questions.

search box

The search box is where the user enter their search query <1>. It will also display auto-completion / concierge if configured <2> for every keystroke.

The shortlist <3> and history <4> toggle allows the user to access the results shortlist and the searches and clicks history.

Search box customization

There are no specific configuration options available for the search box.

The SearchForm macro within the project.ftl defines the search box template and it, along with the CSS that is applied to the search results page, can be modified to customize things such as the icons, search box width and search button text.

Auto-completion

Auto-completion provides the user with real-time suggestions as search terms are typed into the search box.

auto completion

Suggestions are displayed just below the search box. They can be divided into categories <1>, usually corresponding to the tabbed navigation. The display of each suggestion can be highly customised depending on its type (e.g. Course detail <2>, contact details <3>, etc.).

The example above uses three auto-completion data sets, corresponding to the three different columns of auto-completion:

  • Simple word/phrase suggestions, sourced from the document content.

  • People suggestions, sourced from structured data of a staff directory.

  • Courses suggestions, sourced from structured data of a courses database.

The organic suggestions are available out of the box with Funnelback, but structured auto-completion data sets need special configuration.

Each data set corresponds to a collection and a profile to query.

  • The organic data set includes suggestions from all data sources included in the search package.

  • Structured data sets are configured by creating a results page that restricts the results to a specific data source( the data is coming from (e.g. courses, people). See below for instructions of configuring a structured data source.

Configuring a structured data source

To provide structured auto-completion suggestions, a CSV file containing all the possible suggestions need to be generated. For example for staff directory suggestions the CSV file would contain every possible name in the staff directory and what to display for each name.

In a simplified form:

people-suggestions.csv
john,John Doe - Researcher,http://funnelback.edu/staff/j.doe
doe,John Doe - Researcher,http://funnelback.edu/staff/j.doe
mary,Mary Smith - Professor,http://funnelback.edu/staff/m.smith
smith,Mary Smith - Professor,http://funnelback.edu/staff/m.smith

Generating this file manually would be difficult and time consuming. We can leverage the fact that Funnelback is already indexing the staff directory and generate this CSV file from the data Funnelback has indexed.

This is achieved by using a results page that limits the search results to the staff directory, and Funnelback plugin that generates the auto-completion.

Generate an auto-completion data set

  1. Log in to the administration console and select the search package that corresponds to the higher education search.

  2. Create a new results page that will correspond to your auto-completion dataset. e.g. ac-people.

  3. Edit the results page configuration and add the following configuration keys:

    Configuration key Value Description

    query_processor_options

    -clive=<DATA-SOURCE-ID> -log=off -SF=[<LIST-OF-METADATA>]

    Limits the results to items from the data source indicated by <DATA-SOURCE-ID> and disables logging for this results page. Set <LIST-OF-METADATA> to the list of metadata classes to make available in the auto-completion JSON.

    plugin.auto-completion-plugin.enabled

    true

    Enables the auto-completion plugin for this results page.

    plugin.auto-completion-plugin.version

    1.0.0

    Sets the version of the plugin to use.

    plugin.auto-completion-plugin.trigger

    <TRIGGER>

    Sets the source for the auto-completion trigger. This is either title (default) or a metadata class indicated by metadata.<class> (e.g. metadata.firstName).

  4. This will result in an auto-completion data set being generated that can then be used in the main search results page. If you created a results page of ac-people as in the example above then you will be able to configure the auto-completion data set using collection: <SEARCH-PACKAGE-ID> and profile: ac-people

The auto-completion data sets shown in the higher education search are configured via results page settings on the main higher education search.

  1. From the administration console select the search package corresponding to the higher education search you are setting up then select the results page that defines the search results templates for the search (in the setup example this is the FBU search results page that was setup).

  2. Edit the results page settings and add the following configuration keys:

    Configuration key Value Description

    stencils.auto-completion.datasets

    <LIST-OF-DATA-SETS>

    Comma-separated list of data sets to include as the auto-completion. (e.g. organic,people,courses). organic is a special value that is used for the suggestions based on words and phrases in the index.

    stencils.datasets.<DATA-SET>.collection

    $COLLECTION_NAME

    This should be set to $COLLECTION_NAME which is a special variable that will expand to the search package ID. <DATA-SET> must match a value used in the <LIST-OF-DATA-SETS> above.

    stencils.datasets.<DATA-SET>.profile

    <DATA-SET-RESULTS-PAGE-ID>

    Set this to the ID of the results page you set up for the auto-completion data set that you wish to include (for the people data set example above this is ac-people)

    stencils.datasets.<DATA-SET>.name

    <NAME>

    This defines the <NAME> to display for the column of auto-completion corresponding to the data set.

    stencils.datasets.<DATA-SET>.show

    <N>

    Set this to the number of auto-completion results to display for the data set.)

Update the auto-completion template for a specific result type

The auto-completion template is linked to the result type as for search results.

The template for auto-completion is included in the same result-specific Freemarker file with the other result-specific template code. The AutoCompleteTemplate macro in this file defines the auto-completion template.