Configuring KeymatchSource.config


InSite Search is designed to have a single record for each Keymatch term specified, so each Keymatch entry is a unique term record. If you add multiple Keymatch entries for the same term—for example in a CSV file—the InSite Search indexer reads the current value in the list and skips the previous entries for the same term value.

Caution
Terms should be stored in an area separate from other ranking indexes so that they are not included in indexing.

If you use a CSV file to specify Keymatch entries, changes to the CSV file trigger the re-indexing of Keymatch content.

To configure KeymatchSource.config:
  1. 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.
    KeymatchSource.config example
    <?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>
  2. 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 will look similar to the following code:
    Keymatch index files location example
    <Search indexLocation="App_Data\KeyMatch_Index">
  3. 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.
      Keep in mind the referenced CSV file has the following table format.
      ColumnDescription
      TermTerm to match Keymatch results against.
      KeyMatch | PhraseMatch | ExactMatchType of match for this entry. Valid values include:
      • KeywordMatch
      • PhraseMatch
      • ExactMatch

      See KeymatchSource.Config Reference for details about these match types.

      Important
      These values are case sensitive.
      URL to ContentURL that links to the Keymatch result.
      Descriptive TitleText that will be used when rendering the Keymatch link result.
      AbstractThe abstract provided for the Keymatch result.
      For example, the CsvFile<add> element should look similar to the following code:
      Keymatch CSV file location example
      <add name="CsvFile" value="C:\ancillary-resources\keymatch-terms-1.csv" />

      Example CSV File:

      Example Keymatch CSV
      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
    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:
      ContentFieldName setting example
      <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.

      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.

      For example, the ContentKeyMatchType<add> element should look similar to the following code:

      ContentKeyMatchType setting example
      <add name="ContentKeyMatchType" value="KeywordMatch" />
    4. If an <add> element with AdditionalFieldForContentSource as the @name attribute value doesn't already exist, you can create one to index specific field content. For the value , enter the element root name of the field you want to add to the actual page to allow the definition of KeyMatchType. Use the pipe character (|) to delimit fields to index.For example, the following setting will index the Title and Abstract fields:
      AdditionalFieldForContentSource setting example
      <add name="AdditionalFieldForContentSource" value="Title|Abstract" />

      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 indeed and 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, you can create one. In the @value attribute, enter the batch size as an integer for the index to process.
  4. Locate the <add> elements under <Settings>. You will configure these elements in the next steps.
    Important
    You must add a .csv file and/or provide a value for ContentFieldName.
  5. Configure the <add> element with the @name="CsvFile" attribute. In the @value attribute, enter the filepath to the appropriate .csv file, which contains words that get instruction and definition of the CSV contents.

    Keep in mind the referenced .csv file has the following table format.

    ColumnDescription
    TermTerm to match Keymatch results against.
    KeyMatch | PhraseMatch | ExactMatchType of match for this entry. Valid values include:
    • KeywordMatch
    • PhraseMatch
    • ExactMatch

    See KeymatchSource.Config Reference for details about these match types.

    Important
    These values are case sensitive.
    URL to ContentURL that links to the Keymatch result.
    Descriptive TitleText that will be used when rendering the Keymatch link result.
    AbstractThe abstract provided for the Keymatch result.

    For example, the CsvFile<add> element should look similar to the following code:

    Keymatch CSV file location example
    <add name="CsvFile" value="C:\PublishedContent\settings\SearchSource.config" />

    Example CSV File:

    Example Keymatch CSV
    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
  6. Configure the <add> element with the @name="ContentFieldName attribute. In the @value attribute, enter the element root name of a field found within the main index dataset.

    Keymatch DEX Search targets the indexed content in this element.

    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 will look similar to the following code:
    ContentFieldName setting example
    <add name="ContentFieldName" value="BodyCopy" />
  7. Configure the <add> element with the @name="ContentKeyMatchType" attribute. In the @value attribute, enter the Keymatch type that will run against the indexed content.

    Enter the value in pascal-case. Possible values for the @value attribute include:

    ValueDescription
    KeywordMatchAny match word will return results.
    PhraseMatchAny words in secession will return results.
    ExactMatchMust match exactly or nothing will return.

    The ContentKeyMatchType<add> element will look similar to the following code:

    ContentKeyMatchType setting example
    <add name="ContentKeyMatchType" value="KeywordMatch" />
  8. Optional: If the <add> element with the @name="AdditionalFieldForContentSource" attribute doesn't already exist, you can insert this element to index specific field content.

    For the value, enter the element root name of the field you want to add to the actual page to allow the definition of KeyMatchType. Use the pipe character (|) to delimit fields to index.

    For example, the following setting will index the Title and Abstract fields:

    AdditionalFieldForContentSource setting example
    <add name="AdditionalFieldForContentSource" value="Title|Abstract" />
    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 indexed and 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.

  9. Optional: If the <add> element with the @name="BatchSize" attribute doesn't already exist, you can insert this element to set the batch size. In the @value attribute, enter the batch size as an integer for the index to process.

    For example, the BatchSize<add> element should look similar to the following code:

    BatchSize setting example
    <add name="BatchSize" value="20000" />
  10. Save and close KeymatchSource.config.