Configuring an Inclusive List of Fields for Matching Fragment Results in InSite Search

Product: InSite Search

Version: All, ISS 2, 2.6, 2.6.12

Published: June 1, 2017

Last updated: 1/30/2021

Comments:
0 Comments

Description

Matching fragments in returned InSite Search results return all valid fields by default. This feature adds the ability to populate a configuration file with a list of targeted fields to return in the order they are listed. If any field in the provided configuration does not contain the matching term, then the field will not be included in the Matching Fragment results.

Purpose

While it is still a default function of InSite Search to return all viable fields in matching fragments, there are use-case scenarios where only selected fields need to be returned.

Requirements

  • InSite Search 2.6.12 and above.
  • CMS 9 SR6 and above (requirement for InSite Search 2.6.12).
  • CMS Published content to be rendered through a DSS site.

Step-by-Step

  1. Open your DSS project in Visual Studio and update to the latest version of InSite Search 2 via NuGet Package Manager.
  2. Rebuild your project.
  3. Download the following sample configuration file, HiliteFields.xml:

    Hilite Fields configuration file

  4. Edit the copy of HiLiteFields.xml and change the root element's enabled attribute to true.
  5. Modify the configuration file to include additional Field elements.
    • Field name values are the element names that you expect to be returned.
    • Field name values must be inserted between the start and end Field tags.
    • If the file does not contain any Field elements, then the Matching Fragments will fall back to a default state (i.e., returns all valid fields).
  6. Save your configuration file to a new folder within the \Prebuilt folder of your CMS site (e.g., \Prebuilt\Configs).
  7. In your DSS project, modify the search.config to include a new Settings entry to reference your HiLiteFields.xml file.
    • Name: HiliteFieldsFileLocation
    • Value: Absolute path to HiliteFields.xml as it resides on the DSS server after replication (e.g., C:\MyDssSite\Content\Prebuilt\Configs\HiliteFields.xml).

    Note: Recycle your DSS application pool after making these changes.

  8. Publish your CMS. By publishing, the new HiLiteFields configuration file replicates to your DSS server.

Additional Information

  1. This feature requires a separate configuration file that is referenced in your InSite Search implementation's search.config file. These configuration files are intended to reside on the same server environment as the DSS, where the InSite Search implementation lives. To ease the workflow of configuring each file, you can place them in a new folder within your CMS \Prebuilt asset location (e.g., \Prebuilt\SearchConfigs). This way, modified files can be uploaded to this new folder through the CMS Asset Manager. From there, they will be copied over to the DSS server(s) during a publish/replication cycle. If you decide to change the location of the file, you will need to update the Settings entry in search.config to reflect the new path on disk.
  2. If you choose to manage the above configuration file outside of the CMS process, you can check them into the \Config folder at the root of your DSS project. When placed in this location, InSite Search will scan for a valid HiliteFields.xml file automatically and apply the configurations when the application starts.

Comments

There are no comments yet.