Configuring the Keymatch Index


Keymatch Search provides a separate set of data that can be used in conjunction with the standard Lucene search results. The Keymatch feature can be independent of the dynamic execute (DEX) search functionality and be used entirely on its own.

To set up an independent index for Keymatch queries:
  1. Navigate to [Drive]:\[path-to-DSS-root-directory], and open Search.config in a text editor.
    Important
    Search.config acts as a hub for all InSite Search configurations and must be configured before configuring KeymatchSource.config.
    The example below displays generic code contained within Search.config.
    <?xml version="1.0"?>
    <configuration>
        <configSections>
            <section name="Search"
                type="Ingeniux.Search.Configuration.IndexingConfiguration, Ingeniux.Search"/>
        </configSections>
        <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;"/>
            <Settings>
                <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"
                    value="App_Data\DocumentBoostByFacetsFileLocation.xml"/>
                <add name="GSearchFieldMapping"
                    value="[Drive]:\[path to DSS root directory]\[subfolder(s)]\GSearchFieldMapping.xml"/>
            </Settings>
            <IndexingSources>
                <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"
                    settingsFile="App_Data\KeymatchSource.config"/>
                <add name="SpellCheckDictionary" type="Ingeniux.Search.SpellCheckerSearchDocumentSource"
                    settingsFile="App_Data\spellcheckerSource.config"/>
                <add name="SiteCrawlerSource" type="Ingeniux.Search.HtmlSiteSource"
                    settingsFile="App_Data\sitecrawlerSource.config"/>
                <add name="Analytics" type="Ingeniux.Search.AnalyticsSearchDocumentSource"
                    settingsFile="App_Data\analyticSource.config"/>        
            </IndexingSources>
            <SearchProfiles>
                <add name="Independent-search-profile-1">
                    <Sources>
                        <add name="KeyMatch"/>
                        <add name="SpellCheckDictionary"/>
                        <add name="analytics"/>
                    </Sources>
                </add>
            </SearchProfiles>
        </Search>
    </configuration>
  2. On the <Search> element, complete the following steps.
    1. Ensure the @indexLocation attribute value points to the luceneIndex folder, which stores your main content index.
    2. Set the @indexingEnabled attribute value to true.
    Your code should look similar to the following example:
    <Search indexLocation="App_Data\luceneindex" indexingEnabled="true">
  3. If an <add> element doesn't already exist for Keymatch search within the <IndexingSources> element, create one. Complete the following steps in the <add>element:
    1. Enter a unique name as the value of the @name attribute for identification purposes.
    2. Enter Ingeniux.Search.KeyMatchSearchDocumentSource as the value of @type attribute.
    3. Enter the filepath to KeymatchSource.config for the value of the @settingsFile attribute.
      Note
      You can use a relative path to the default Keymatch configuration file (i.e., App_Data\KeymatchSource.config), which is included during installation.
    For example, your Keymatch search <add> element and attributes should look similar to the following code:
    <add name="KeyMatch" type="Ingeniux.Search.KeyMatchSearchDocumentSource"
    settingsFile="App_Data\KeymatchSource.config" />
  4. Save and close Search.config.
  5. Navigate to KeymatchSource.config and open the file in a text editor.
    Note
    This source file can reside anywhere. Generally, the App_Data folder contains KeymatchSource.config. (e.g., [Drive]:\[path-to-DSS-root-directory]\App_Data\KeymatchSource.config).
    The example below displays generic code contained within KeymatchSource.config.
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <configSections>
            <section name="Search" type="Ingeniux.Search.Configuration.IndependentIndexingSourceConfig, Ingeniux.Search" />
        </configSections>
        <Search indexLocation="App_Data\KeyMatch_Index">
            <Settings>
                <!-- tracking cycles are
                    year
                    month-->
                <add name="CsvFile" value="C:\ancillary-resources\keymatch-terms-1.csv" />
                <add name="ContentFieldName" value="BodyCopy" />
                <add name="ContentKeyMatchType" value="KeyMatch" />
            </Settings>
        </Search>
    </configuration>
  6. Locate the <Search> element, and enter the filepath to the Keymatch index files as the value of the @indexLocation attribute.
    Note
    The default value is App_Data\KeyMatch_Index.
    For example, the <Search> element opening tag should look similar to the following code:
    <Search indexLocation="App_Data\KeyMatch_Index">
  7. Locate the <Settings> element, and set the following attribute values for the nested <add> elements:
    Important
    You must add a *.csv file and/or provide a value for ContentFieldName.
    1. Locate the<add> element with CsvFile as the @name attribute value. In the @value attribute, enter the filepath to the appropriate CSV file, which contains words that get instruction and definition of the CSV contents.
      Additional Information
      The CSV file has the following four-column format.
      ColumnDescription
      TermTerm to match Keymatch results against.
      KeyMatch | ExactMatchType of match for this entry. Valid values: KeywordMatch or ExactMatch.

      See KeymatchSource.Config Reference for details.

      URL to ContentURL that links to the Keymatch result.
      Descriptive TitleText that will be used when rendering the Keymatch link result.

      Example CSV File:

      experience,KeywordMatch,http://www.ingeniux.com,Ingeniux Website 1
      headless,KeywordMatch,https://www.ingeniux.com/solutions/headless-cms-and-content-as-a-service,Ingeniux Headless Service 
      For example, the CsvFile<add> element should look similar to the following code:
      <add name="CsvFile" value="C:\ancillary-resources\keymatch-terms-1.csv" />
    2. Locate the <add> element with ContentFieldName as the @name attribute value. In the @value attribute, enter the element root name of a field found within the main index dataset, wherein the Keymatch index is to be created from.
      Important
      Ensure the element root field name exists in the page type (i.e., schema) for the CMS content you plan to index. If the element nests inside a group element, provide the full element path to the nested element for the @value attribute.
      For example, the ContentFieldName<add> element should look similar to the following code:
      <add name="ContentFieldName" value="BodyCopy" />
    3. Locate the <add> element with ContentKeyMatchType as the @name attribute value. In the @value attribute, enter the method by which to search against the indexed content.
      Additional Information
      Enter the value in pascal-case. Possible values for the @value attribute include:
      ValueDescription
      KeywordMatchAny word hit will return results.
      PhraseMatchAny of the words in conjunction will return results.
      ExactMatchMust match exactly, or nothing will return.
      See KeymatchSource.Config Reference for details about each value.
    4. If an <add> element with AdditionalFieldForContentSource as the @name attribute value doesn't already exist, create one. In the @value attribute, enter the element root name of the field that you want to add to the actual page to allow definition of KeyMatchType.

      Additional Information
      This value falls back on the global setting, but the per-page setting would be an override on the type If a field is present and has a valid value, then the field is used instead of the global setting. These element values are stored for retrieval, but not analyzed.

      For example, if the Title element is added to this list, then the values for Title display in the returned result set's child elements.

    5. If an <add> element with BatchSize as the @name attribute value doesn't already exist, create one. In the @value attribute, enter the batch size as an integer for the index to process.
  8. Save and close KeymatchSource.config.
 

Related Topics