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
June 1, 2017
Last updated: 1/30/2021
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.
- 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.
Open your DSS project in Visual Studio and update to the latest version of InSite Search 2 via NuGet Package Manager.
Rebuild your project.
Download the following sample configuration file, HiliteFields.xml:
Edit the copy of HiLiteFields.xml and change the root element's enabled attribute to true.
- 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).
- Save your configuration file to a new folder within the \Prebuilt folder of your CMS site (e.g., \Prebuilt\Configs).
- 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.
- Publish your CMS. By publishing, the new HiLiteFields configuration file replicates to your DSS server.
- 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.
- 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.