How to Configure Your Similar Documents Component
- Navigate to your SmartHub installation directory.
- Open the sub-folder \modules\SimilarDocuments\.
- 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
- The number of results from the original results set that are used to extract the metadata values and build the similar documents requests.
- The documents are prioritized based on the order in which they are returned by the search engine The search engine your SmartHub instance uses to perform queries. SmartHub can be configured to use more than one search engine.
- 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.
- ContentBySearchId
-
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 || [])
}