Knowledge Base

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

InSite Search 2.6.12 and above supports an inclusive list of fields that specifies the order of returned fields within the results set.


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:
    HiliteFields.xml Sample Sample
    <HiliteFields enabled="true">
        <Field wildcard="true">Title</Field>
        <Field>Abstract</Field>
        <Field>BodyCopy</Field>
        <Field>name</Field>
        <Field>fulltext</Field>
        <Field>path</Field>
    </HiliteFields>
  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.
  • PRODUCT: InSite Search
  • Published: June 1, 2017
  • LAST UPDATED: September 18, 2023
  • Comments: 0

Please login to comment

Comments


There are no comments yet.