Configuring HiliteFields

Matching fragments in returned InSite Search results return all valid fields by default. When you enable HiliteFields, search results display according to the Field order in the HiliteFields configuration file. These search results will display until the maximum character limit is reached. 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.

To configure HiliteFields.xml:
  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 Visual Studio project.
  3. Download the following sample configuration file: HiliteFields.xml.The example below displays generic code contained within HiliteFields.xml.
    <HiliteFields enabled="true">
       <Field wildcard="true">Bod</Field>
       <Field partialfieldnamematch="true">Heading</Field>
  4. Open HiLiteFields.xml in a text editor, 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 indexed fields that contain values used in matching fragments for terms. The fields generally match the element names that you expect to be returned (e.g., "Abstract").
    • <Field> name values must be inserted between the start and end <Field> tags.
    • When the value of the @wildcard attribute (Boolean) on the <Field> element is set to true, then all instances of the element name are included in the highlighted search results.

    For example, for Title__One and Title__Two, then:

    <Field wildcard="true">Title</Field>            
    If the file does not contain any <Field> elements, then the Matching Fragments fall back to a default state (i.e., returns all valid fields).
  6. Save your configuration file to your DSS server.
    If you save HiliteFields.xml to the Config folder (e.g., [Drive]:\[path to DSS root directory]\Config\HiliteFields.xml), then you can skip the next step. You do not need to configure Search.config — because the Config folder is the default location of HiliteFields.xml.
  7. Navigate to [Drive]:\[path-to-DSS-root-directory], and open Search.config in a text editor. The example below displays generic code contained within Search.config.
    <?xml version="1.0"?>
            <section name="Search"
                type="Ingeniux.Search.Configuration.IndexingConfiguration, Ingeniux.Search"/>
        <Search indexLocation="App_Data\LuceneIndex"
            synonymslocation="[Drive]:\[path to DSS root directory]\published\iss-config\Synonyms.xml"
            indexingEnabled="true" queryMaxClauses="1024">
            <Hiliter startTag="&lt;strong&gt;" endTag="&lt;/strong&gt;"/>
                <add name="defaultIndexingAnalyzer"
                    value="Ingeniux.Search.Analyzers.StemmingIndexingAnalyzer, Ingeniux.Search"/>
                <add name="defaultQueryAnalyzer"
                    value="Ingeniux.Search.Analyzers.StemmingQueryAnalyzer, Ingeniux.Search"/>
                <add name="QueryFieldsFileLocation"
                    value="[Drive]:\[path to DSS root directory]\[subfolder(s)]\QueryFields.xml"/>
                <add name="DocumentBoostByFacetsFileLocation"
                <add name="GSearchFieldMapping"
                    value="[Drive]:\[path to DSS root directory]\[subfolder(s)]\GSearchFieldMapping.xml"/>
                <add name="CMSPublishedContent" type="Ingeniux.Runtime.Search.DssContentSearchSource"
                    settingsFile="[Drive]:\[path to DSS root directory]\settings\SearchSource.config"/>
                <add name="KeyMatch" type="Ingeniux.Search.KeyMatchSearchDocumentSource"
                <add name="SpellCheckDictionary" type="Ingeniux.Search.SpellCheckerSearchDocumentSource"
                <add name="SiteCrawlerSource" type="Ingeniux.Search.HtmlSiteSource"
                <add name="Analytics" type="Ingeniux.Search.AnalyticsSearchDocumentSource"
                <add name="Independent-search-profile-1">
                        <add name="KeyMatch"/>
                        <add name="SpellCheckDictionary"/>
                        <add name="analytics"/>
  8. In Search.config, include an <add> tag within <Settings>, then set the following attributes:
    • @Name: HiliteFieldsFileLocation
    • @Value: Enter an absolute path to the configuration file as it resides on the DSS server after replication (e.g., [Drive]:\[path to DSS root directory]\[subfolder(s)]\HiLiteFields.xml).
  9. Save and close Search.config.
  10. After the initial configuration of HiliteFieldsFileLocation, recycle the DSS application pool so that the system picks up the new file's location.
    All subsequent changes to HiLiteFields.xml are reflected in search results.