How to Configure Your Similar Documents Component

  1. Navigate to your SmartHub installation directory.

  2. Open the sub-folder \modules\SimilarDocuments\.

  3. Open the file configuration.js in a text editor such as Notepad++ and change the file depending on which type of similar documents requests you want to execute:

    Configuration File Components
      • ContentBySearchId
        •  Represents the name of the Content-by-Search component from the Results.html page.
        • This setting enables you to configure each component from the search page separately.

      • Properties
        •  The metadata properties (can one or more properties) retrieved from the original results set and used to build the similar documents request.
        • Represents which metadata you want to query for similarity between documents.

      • TotalNumberOrResults
      • PerPropertyValueUsedCount
        • The number of unique values used for each metadata from the original results when building the similar documents request
        • The metadata values are prioritized based on number of occurrences in the selected results

      • ExclusionProperty 
        •  The property that will be used in the similar documents request to filter results that were already returned by the initial query.
        • In general it is recommended to use the "clickUri" or document URL because that uniquely identifies a document in a search index.
        • This property's values are used to build a negative query along with the similarity search.

Configuration File Example

Example
Copy
SH.fakeNodeEnvironment();
module.exports = {
 Configuration: [
 {
 "ContentBySearchId": "SimilarDocumentsComponent",
 "Properties": [
 "DOCUMENTENTITIES" ],
 "TotalNumberOfResults": 10,
 "PerPropertyValuesUsedCount": 4,
 "ExclusionProperty" : "clickUri" }, 
 {
 "ContentBySearchId": "SimilarDocumentsComponent2",
 "Properties": [
 "DocumentEntitiesO365", "Department" ],
 "TotalNumberOfResults": 2,
 "PerPropertyValuesUsedCount": 4,
 "ExclusionProperty" : "clickUri" }]
}
{
 SH.SimilarDocuments = SH.SimilarDocuments || {}

 module.exports = SH.mergeWithExclude(module.exports, 
SH.SimilarDocuments.CustomSettings || {}, 
SH.SimilarDocuments.PathsToExclude || [])
}