NetDocuments
Use the following topics to connect your SmartHub instance to the NetDocuments search engine (search engine).
Important Mentions and Limitations
Please note the following limitations before configuring your NetDocuments search engine:
Item | Limitation |
---|---|
Facets |
|
Document Title Hit Highlighting |
|
Summary Text Exception |
|
Search Operators |
The following search operators are not supported:
|
Date Refiners |
|
Search Within Refiners |
|
Query Parameters |
|
Note: A service account can only be used with a single SmartHub instance at any one time.
Prerequisites
To correct this, set the CoveoFacets components to data-preload-values="true"
. This is done to the following HTML pages in your site:
-
The Results HTML page.
-
The Custom Results HTML page.
-
Any custom HTML page that use refiners.
User Access Requirements
NetDocuments security is performed using two methods:
- Security token authentication
- User account-level security trimming
After token authentication is performed, security trimming is performed against the active SmartHub user account.
- SmartHub users can only access the NetDocuments cabinets their account has permissions to on the NetDocuments side.
- The account used to configure token authentication is also used for security trimming.
- This account must have admin access (be a cabinet administrator) to all the cabinets the NetDocuments search engine is to search.
- See Verify Cabinet Administration Permissions below.
- Additionally, Administrator requirements, specifically, are specified below.
Administrator Requirements
-
The user account that configures token authentication must be an Administrator on the NetDocuments cabinets being searched.
- The user must be a cabinet administrator
- Admin access to cabinets that will not be searched is not required.
-
SmartHub requires the Admin user to have the following permissions:
- Permission to retrieve cabinets
-
Permission to READ other user's details.
-
Specific endpoints used:
Copy"/v2/search";
"/v1/User/cabinets";
"/v1/User/{0}/info";
Verify Cabinet Administration Permissions
Verify the user account used the configure token authentication has cabinet administration permissions.
- In NetDocuments, open a cabinet that will be indexed by the BA Insight NetDocuments search engine and searched by users.
- Select the drop-down menu for the cabinet and select Cabinet Information.
- The Cabinet administrator user accounts are shown listed here. See the image below.
- The user account used for token authentication MUST be shown in this list for each and every cabinet to be searched by the BA Insight NetDocuments search engine.
User Account Requirements
Security trimming is performed at the user account level.
- SmartHub users can only access the NetDocuments cabinets their account has permissions to on the NetDocuments side.
- Security trimming is performed by the NetDocuments search engine for the user account searching NetDocuments cabinets.
- A user's account must have permission to read from the NetDocuments cabinets to successfully search them.
Cabinets
-
The cabinets you access must be in the same repository.
-
To search cabinets from multiple repositories you must configure a separate SmartHub NetDocs search engine for each repository.
-
- SmartHub only queries the cabinets the authenticated user account has access to (within NetDocuments).
How to Add a NetDocuments Search Engine
- Navigate to the SmartHub Administration page at http(s)://[web-app-url]/_admin
- For example: http://smarthub.azurewebsites.net/_admin .
- For example: http://smarthub.azurewebsites.net/_admin .
- From the General Settings page click Add New Search Engine to add your new NetDocuments search engine.
- The Search Engine dialogue appears.
- In the Type field, select Regular.
- From the Search Enginedrop-down list, select NetDocs.
- In the Name field, Enter a name for your search engine.
- In the Rank offset formula coefficients field, enter values for the Boost and Offset. Enter these values only if you selected the Rank Based mixing algorithm that is set in the Properties for SSA page.
- In the Data Center Region field, select your preferred data center from the drop-down list. The supported Data Center regions are: US, UK, DE, AU. The default data center is US.
- In the Auth Provider Email field, enter the email property of your Authentication provider used for security trimming. This property must contain the NetDocs user email. When using AAD authentication, ensure that the email claim is added as an ID token.The default "upn" might not contain the email address of the user. See How to Configure Security Trimming for Windows Authentication for info about how to create a new claim which has the user's email.
- In the Cabinets field, enter a comma separated list of cabinets to be used for search. You can also specify "*" to search all cabinets where the user has access to.
The default value for this field is
cabinet1, cabinet2
. - In the Attributes to return field, enter a comma separated list of attributes to return from NetDocuments. The default value for this field is
StandardAttributes, CustomAttributes, Locations, Descriptions, VersionsLite, CheckedOutBy, AllowCheckedOutState, EmailAttributes
. - NetDocuments has identifiers for every search field. In the Facets field, you can map each facet on the page to its unique field identifier. The default value for this field is
Ext,11;Modified,5;CreatedBy,6
. - In the Supported Fields field, enter a comma separated list of the most common supported identifiers. If the field identifier is not found on this list, or isn't in XXXX format, the query will return 0 results. The default value for this field is
3,4,5,6,7,8,11,17,18,19,20,27,54,55,56,250,999
. - If Search All Versions is enabled, the search matches a document if any of its versions contain the user search keywords. For more information, see How to Configure Multi-version Search.
- Click Authorize, after you will be redirected to a NetDocuments page to provide credentials. See Authorization below.
Authorization
- Use your NetDocuments account credentials to log in.
- Click Allow to give the application full access to all resources.
- Note: If you have multiple repositories, and you want results from all of them you must set up a different NetDocuments search engine for each repository.
- Note: If you have multiple repositories, and you want results from all of them you must set up a different NetDocuments search engine for each repository.
- Click Authorize.
- Return to the SmartHub administration portal, and copy the code in the Authorization Code text box.
- Click Get Access/Refresh Tokens . A new page will open with the Access and Refresh tokens.
- Copy and paste the Access and Refresh tokens into the fields in the SmartHub administration portal.
- Click the OK button.
How to Configure Security Trimming for Windows Authentication
After you have configured your NetDocuments search engine, as described above, use the instructions below to insert a script to enable SmartHub to trim query results according to each user's access rights.
- Under Pipeline Stages for your NetDocuments search engine, select Add New Query Stage.
- Select Query Scripting Processor.
- Name the pipeline stage.
- Leave the Referenced Assemblies and Imported Namespaces fields empty
- Enter the following script in the Script field and replace the following variables with the appropriate values for you environment:
- var domainName:
- Enter the URL of your domain inside quotes.
- For example, "acmedomain.com"
- userContext.SetProperty():
- This value ("netDocsEmail" in the code snippet below) can be any text.
- This value needs to be added to the NetDocs Search Engine settings, replacing the already existing value in the Auth Provider Email property field.
Copyvar userContext = BAInsight.Longitude.Federator.Runtime.Security.SecurityPermissions.Load() as BAInsight.SmartHub.Core.Security.Context.JWTUserContext;
var domainName = "YourDomain.com"; // the domain of the user account
var username = userContext.GetProperty("upn", ""); // this retrieves the user name
userContext.SetProperty("netDocsEmail", username + "@" + domainName); // this generates the user address in the required format: username@domain.com
- var domainName:
- Click OK to close the window.
How to Configure the Property Mapper with NetDocuments Properties
Perform the following steps to discover properties in NetDocuments that you can map in SmartHub:
- Login to NetDocuments with an Admin account.
- Access the Admin Console by clicking Admin from the top right drop-down menu.
- Go to the Navigation menu (top left) and select Profile Attributes.
- The Profile Attributes or similar window appears, as shown below:
- Use the property names and numbers ("Id" column) shown here in the SmartHub Property Mapper.
- Examples: MatterId,1002;
- For nested profile attributes, you can reference them by their ID preceded by their parent ID.
- Examples: MatterId, 1001.1002;
- Note: Only parent-child attributes can be mapped. There is no support for parent-child-grandchild types.
- You can also use composed property mappings that point to the specific field(s) you want returned.
For instance:- Value
- Returns the value field of the property
- Examples: ClientId, 1001.Value;
- By default, properties will be linked to the Value field
- "ClientId, 1001" is the same as "ClientId, 1001.Value"
- Returns the value field of the property
- Description
- Returns the description field of the property
- Examples: ClientName, 1001.Description;
Important! NetDocs does not support "deep" search-within for Description properties.
However, SmartHub will let you do a "shallow" search-within using the max number of facet values returned by NetDocs (top 100 values). - Returns the description field of the property
- ValueAndDescription
- Returns the description and value fields of the property with the format "description (value)"
- Examples: Client, 1001.ValueAndDescription;
- Returns the description and value fields of the property with the format "description (value)"
- Value
- Nested profile attributes can be used as composed property mappings as well, for any type of field:
- Examples: Matter, 1001.1002.ValueAndDescription;
- Note: If you are using composed property mappings, make sure that AttributesToReturn contain the Descriptions field.
- Examples: Matter, 1001.1002.ValueAndDescription;
-
You can add custom results properties in your custom settings file, under FieldstoInclude of the
ContentContainers
section:CopyCustom Settings ExampleSH.ContentContainers = SH.ContentContainers || {};
SH.ContentContainers.CustomSettings = {
MainResults: {
FieldsToInclude: 'clickUri,title,Rank,ContentSource,FileExtension,excerpt,SDFUrl,date,DisplayAuthor,isUserProfile,isAuth,isError,HitHighlightedSummary,WorkEmail,JobTitle,Department,AboutMe,escbasecrawurl,UserName,PictureUrl'
}
};-
Custom properties include:
-
Cabinets,Repositories,Url,Email,DocId,EnvId,DocNum
-
- For nested properties, like Versions, CheckedOut or Email, you can access them via Versions.Official or CheckedOut.Name.
- Versions accepted fields:
- Annotations, AutoVersion, Count, LatestVersionLabel, LatestVersionNumber, Official, OfficialVersionLabel, OfficialVersionName, SearchInfo, TotalSize
- Note: Make sure that AttributesToReturn contains the VersionsLite field.
- CheckedOut accepted fields:
- Comment, Guid, Name, When
- Note: Make sure that AttributesToReturn contains the CheckedOutBy,AllowCheckedOutState fields.
- Email accepted fields:
- MessageId, Subject, From, To, CC, ConversationId, EmlConversationId, MessageClass
- Note: Make sure that AttributesToReturn contains the EmailAttributes field.
- Versions accepted fields:
-
Logs
By default, logs appear in the directory <SmartHub_Install_Directory>\Logging
How to Enable/Disable Hit-Highlighting
- Navigate to the SmartHub Administration page.
- Select the NetDocuments search engine.
- Modify the Property Mapper from both "Query Pipeline Stages" and "Results Pipeline Stages" sections by adding/removing the following mapping: excerpt,Highlight;
- Save the change.
How to Overwrite the Search Query Flags
- Navigate to the SmartHub administration page.
- Select the NetDocuments search engine.
- Click Add New Query Stage.
- From the dropdown select Query Scripting Processor.
- Provide a name for this pipeline stage.
-
In the Script section add the following code:
Script
CopyQuery.ExtendedProperties.Add("NetDocsQueryFlags", "<custom_flags>");
When "NetDocsQueryFlags" is present, the current flags are overwritten. This enables you to control different query flags that NetDocuments expects, such as AggregateResults when doing multi-version search.
- Compile and Save.
How to Configure Multi-version Search
About
-
When “Search All Versions” functionality is enabled, the search matches a document if any of its versions contain the user search keywords.
-
The search engine returns the latest document version that matched the search keywords together with information about all the other versions that matched the user search keywords - as you can see in the JSON example below:
Sample - Multi-version JSON response
{
"TotalRelevantResults": 6,
"TotalRelevantResultsIncludingDuplicates": 6,
"TotalRelevantResultsRowCount": 1,
"RelevantResults": [
{
"Properties": [
{
"Name": "title",
"Type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"Value": "animalTest",
"DateTimeMode": 3
},
{
"Name": "filetype",
"Type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"Value": "docx",
"DateTimeMode": 3
},
{
"Name": "FileExtension",
"Type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"Value": "docx",
"DateTimeMode": 3
},
{
"Name": "Size",
"Type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"Value": "12324",
"DateTimeMode": 3
},
{
"Name": "date",
"Type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"Value": "9/9/2022 10:39:56 AM",
"DateTimeMode": 3
},
{
"Name": "clickUri",
"Type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"Value": "https://vault.netvoyage.com/neweb2/goid.aspx?id=4886-1104-6442&open=y&ver=9",
"DateTimeMode": 3
},
{
"Name": "Versions",
"Type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"Value": "{\"Count\":15,\"Official\":15,\"OfficialVersionName\":\"v15\",\"OfficialVersionLabel\":\"15\",\"LatestVersionLabel\":[15,0],\"LatestVersionNumber\":15,\"AutoVersion\":false,\"Annotations\":false,\"Versions\":[{\"Number\":15,\"Label\":\"15\",\"IsLatest\":true,\"Created\":\"2022-09-09T10:39:56Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":14,\"Description\":\"\",\"Name\":\"v15\",\"Official\":true,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-09-09T10:39:56.524Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":{\"Hit\":true,\"NameHits\":[],\"Snippets\":[]},\"Size\":12324},{\"Number\":14,\"Label\":\"14\",\"IsLatest\":false,\"Created\":\"2022-09-09T08:26:36Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":13,\"Description\":\"\",\"Name\":\"v14\",\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-09-09T08:26:36.592Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":{\"Hit\":true,\"NameHits\":[],\"Snippets\":[]},\"Size\":12236},{\"Number\":13,\"Label\":\"13\",\"IsLatest\":false,\"Created\":\"2022-09-08T14:29:34Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":12,\"Description\":\"\",\"Name\":\"v13\",\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-09-08T14:29:34.794Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":{\"Hit\":true,\"NameHits\":[],\"Snippets\":[]},\"Size\":12172},{\"Number\":12,\"Label\":\"12\",\"IsLatest\":false,\"Created\":\"2022-09-08T12:48:01Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":11,\"Description\":\"\",\"Name\":\"v12\",\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-09-08T12:48:01.854Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":{\"Hit\":true,\"NameHits\":[],\"Snippets\":[]},\"Size\":12106},{\"Number\":11,\"Label\":\"11\",\"IsLatest\":false,\"Created\":\"2022-08-31T08:58:59Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":9,\"Description\":\"\",\"Name\":\"v11\",\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-08-31T08:58:59.529Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":{\"Hit\":true,\"NameHits\":[],\"Snippets\":[]},\"Size\":12089},{\"Number\":10,\"Label\":\"10\",\"IsLatest\":false,\"Created\":\"2022-08-29T13:09:43Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":9,\"Description\":\"\",\"Name\":\"v10\",\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-08-29T13:09:44.136Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":null,\"Size\":12118},{\"Number\":9,\"Label\":\"9\",\"IsLatest\":false,\"Created\":\"2022-08-29T11:35:46Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":8,\"Description\":\"\",\"Name\":\"v9\",\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-08-29T11:35:46.404Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":{\"Hit\":true,\"NameHits\":[],\"Snippets\":[]},\"Size\":12122},{\"Number\":8,\"Label\":\"8\",\"IsLatest\":false,\"Created\":\"2022-08-29T07:48:24Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":6,\"Description\":\"\",\"Name\":\"v8\",\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-08-29T07:48:24.536Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":null,\"Size\":12088},{\"Number\":7,\"Label\":\"7\",\"IsLatest\":false,\"Created\":\"2022-08-23T13:38:08Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":6,\"Description\":\"\",\"Name\":\"v7\",\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-08-23T13:38:08.401Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":null,\"Size\":12052},{\"Number\":6,\"Label\":\"6\",\"IsLatest\":false,\"Created\":\"2022-08-09T13:07:50Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":5,\"Description\":\"\",\"Name\":\"v6\",\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-08-09T13:07:50.223Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":null,\"Size\":12086},{\"Number\":5,\"Label\":\"5\",\"IsLatest\":false,\"Created\":\"2022-08-08T14:12:16Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":4,\"Description\":\"\",\"Name\":\"v5\",\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-08-08T14:12:17.106Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":null,\"Size\":12098},{\"Number\":4,\"Label\":\"4\",\"IsLatest\":false,\"Created\":\"2022-08-05T10:42:31Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":3,\"Description\":\"\",\"Name\":\"v4\",\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-08-05T10:42:31.557Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":null,\"Size\":12065},{\"Number\":3,\"Label\":\"3\",\"IsLatest\":false,\"Created\":\"2022-07-21T11:33:15Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":2,\"Description\":\"\",\"Name\":\"v3\",\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-07-21T11:33:15.125Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":null,\"Size\":12038},{\"Number\":2,\"Label\":\"2\",\"IsLatest\":false,\"Created\":\"2022-07-21T11:30:52Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":1,\"Description\":\"\",\"Name\":\"v2\",\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-07-21T11:30:52.874Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":null,\"Size\":12022},{\"Number\":1,\"Label\":\"1\",\"IsLatest\":false,\"Created\":\"2022-07-21T11:24:49Z\",\"CreatedByGuid\":\"VAULT-18SI78J7\",\"Source\":0,\"Description\":null,\"Name\":null,\"Official\":false,\"Locked\":false,\"Ext\":\"docx\",\"Modified\":\"2022-07-21T11:25:23.124Z\",\"ModifiedBy\":\"Daniela Birsan\",\"ModifiedByGuid\":\"VAULT-18SI78J7\",\"DeliveryRevoked\":false,\"Annotations\":false,\"Search\":null,\"Size\":11991}],\"SearchInfo\":false,\"TotalSize\":181607}",
"DateTimeMode": 3
},
{
"Name": "Rank",
"Type": "System.Double, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"Value": 0.0,
"DateTimeMode": 3
}
],
"FederatorMetadata": {
"Federatorsearch engine": "netdocs",
"FederatorPositionInsearch engine": 0,
"Federatorsearch engineRank": 0.0
}
}
],
"RelevantResultsProperties": {},
"ResultBlocks": [],
"RefinementResults": [],
"EvaluationResults": [],
"QueryTerms": {},
"KeywordInformation": {
"Key": "",
"Value": "" },
"PerformanceInformation": {
"search enginePerformance": [
{
"search engineName": "netdocs",
"search engineTime": 893,
"TotalTime": 893,
"PipelinePerformance": {
"PipelinesPerformance": [
{
"Counters": {
"PropertyMapper_ProcessText_GetExpressionTree": 0,
"PropertyMapper_ProcessText_UpdatePropertyNames": 0,
"PropertyMapper_ProcessText_RenderExpressionTree": 0,
"PropertyMapper_Process_QueryText": 0,
"PropertyMapper_ProcessText_GetExpressionTree_1": 0,
"PropertyMapper_ProcessText_UpdatePropertyNames_1": 0,
"PropertyMapper_ProcessText_RenderExpressionTree_1": 0,
"PropertyMapper_Process_QueryTemplate": 0,
"PropertyMapper_MapProperties": 0,
"PropertyMapper_Process_ProcessCollapseSpecification": 0,
"PropertyMapper_Process_ProcessPropertyList": 0,
"PropertyMapper_Process_ProcessPropertyList_1": 0,
"PropertyMapper_Process_ProcessSortList": 0,
"PropertyMapper_Process_ProcessRefiners": 0,
"PropertyMapper_Process_ProcessRefinementFilters": 0,
"PropertyMapper_Process_CustomRefinementIntervals": 0,
"PropertyMapper_Process_HiddenConstraints": 0
}
}
]
},
"Counters": {
"RunQuery_FederatedImpersonation": 0,
"RunQuery_SetLog4NetContext": 0,
"RunQuery_PrepareQuery": 0,
"RunQuery_SelectPipelineStages": 0,
"RunQuery_ExecuteQueryPipeline": 0,
"RunQuery_ExecuteResultsPipeline": 0,
"RunQuery_AddFederatorMetadata": 0,
"RunQuery_PerformanceInformation": 0,
"RunQuery_CleanLog4NetContext": 0,
"search engineThreadStart_WaitForRunQuery": 893,
"search engineThreadStart_OnAfterQueryExecution": 0
}
}
],
"PipelinePerformance": {
"PipelinesPerformance": []
},
"TotalTime": 0,
"Observations": [
"Slowestsearch engine: netdocs took 893ms" ],
"Counters": {
"PreparingFederatorEngine": 0,
"PreparingPipelineStages": 0,
"ExecutedQueryPipelineStages": 0,
"Preparingsearch engines": 0,
"Querysearch engines_PrepareQueryForsearch engines": 0,
"QueryAllsearch engines_Filtersearch engines": 0,
"QueryAllsearch engines_search engineThreadCreationAndJoin": 894,
"ReceivedResultsFromsearch engines": 895,
"MixingResults": 0,
"CloningQuery": 0,
"ExecutedResultsPipelineStages": 0,
"Pagination": 0
}
},
"SuppressPagination": false,
"IsNotFirstPage": false,
"BelongToSingleSource": false,
"TableCollectionProperties": {},
"search engineName": "netdocs",
"TableProperties": {},
"PeopleSuggestions": [],
"QuerySuggestions": [],
"ResultSuggestions": [],
"RefinementsInfo": {
"RefinementsWithMoreValues": {}
}
}
Navigate to the SmartHub administration page.
Select the NetDocuments search engine.
In the Search Engine Settings modal window, add "Versions" to the Attributes to Return list.
Click Save.
- If “Search All Versions” is enabled:
- The URL of a returned document includes the version denoted by the presence of the URL query parameter: “&ver=”
- Example:
- The URL of a returned document includes the version denoted by the presence of the URL query parameter: “&ver=”
- If “Search All Versions” is not enabled:
- The URL does not include the parameter: “&ver=”
- Example:
- The URL does not include the parameter: “&ver=”
Prerequisites
- The NetDocuments tenant used by the SmartHub search engine must have Search Versions functionality enabled.
- This is a separate NetDocuments feature that is not enabled by default.
- Make sure you have a Search Versions checkbox under the Everything field on the Advanced Search window in the NetDocuments search portal.
Enable/Disable "Search All Versions" functionality
- Navigate to the SmartHub administration page.
- Select the NetDocuments search engine.
- In the search engine Settings modal window, enable/disable the Search All versions slider.
- Click Save.
Generate Previews for Multi-version Search Results
Note: Starting with SmartHub 5.6, previews for NetDocuments documents will work only if you have installed SmartPreviews 3.3.
Note: The URL format for NetDocuments documents has been changed in SmartHub 5.6. This means that document URLs are no longer backward compatible with previous versions of SmartHub, thus the Smart Previews “PreviewCache“ database is obsolete. You must regenerate Previews for NetDocuments documents. See How to Remove Previews from Your Configured Storage.
Online Generation
Smart Previews online preview generation will continue to work with Search All Versions, both enabled and disabled.
Smart Preview Import Server rules are exclusive. This means that you cannot have both online preview generation and offline preview generation for the same category of documents
-
Example: Documents that are under 5 MB.
When the Search All Versions search engine option is enabled and Smart Previews rules are set to do offline preview generation (you have previews generated at crawl time only for the official version of the document), you must configure Smart Previews to do online preview generation for the other versions of the document other than the official one.
-
This is done through a SmartHub scripting stage.
-
This stage forces the online preview generation for documents that are a version different from the official versions, by changing the “PreviewStatusValue” metadata to a value of 2 as described in the topic How to Overwrite Preview Status Value.
Note: Generating previews on-demand for large documents might take a longer time. The Ul shows the info message “Generating preview for this document is taking longer than 10 seconds. Please check back in a few minutes.”. Both the message and the default UI timeout can be configured as described in the How to Add Smart Previews to Your Results Page.
Offline Generation
Offline Generation with Connectivity Hub and NullTarget
-
Smart Previews offline preview generation will work ONLY for the “official” version of the NetDocuments documents.
-
Generating previews for any non-official version is only possible on-demand. See the above section "Online Generation" for details.
Prerequisites
- Connectivity Hub must be installed and configured.
- NetDocuments Connector must be installed and configured.
- NetDocuments connection and content must be created.
- NullTarget must be created.
Configure Offline Generation
In order for previews to be generated offline (at crawl time) using NullTarget, use these steps:
- Navigate to the Connectivity Hub home page.
- Access the Metadata page of the NetDocuments content that uses NullTarget.
- Create a new Text metadata:
- Title: PreviewUrl (do not change this name).
- Description: Add a description for this metadata.
- For example: "The url used by Smart Previews to generate preview."
- Value:
- Select Define by script
Add script:
If "Search All Versions" is enabled, add a script that uses the display URL and changes it to contain the version number:
Example: https://vault.netvoyage.com/neweb2/goid.aspx?id=4840-1183-7122&open=y&ver=3CopyDim url As String = Host.GetValue("spw_url")
Dim new_url As String = url & "&ver=" & Host.GetValue("OfficialVersion")
return new_url.ToLower()Note: If the display URL (escbase_url) property contains "api." you need to remove it from the URL.
Example:CopyDim url As String = Host.GetValue("spw_url")
Dim new_url As String = url.Replace("api.", "") & "&ver=" & Host.GetValue("OfficialVersion")
return new_url.ToLower()If "Search All Versions" is disabled, add a script that uses the display URL:
Example: https://vault.netvoyage.com/neweb2/goid.aspx?id=4840-1183-7122&open=yCopyDim url As String = Host.GetValue("spw_url")
return url.ToLower()Note: If the display URL (escbase_url) property contains "api." you need to remove it from the URL.
Example:CopyDim url As String = Host.GetValue("spw_url")
Dim new_url As String = url.Replace("api.", "")
return new_url.ToLower()
- Make sure that the returned URL is lowercase.
- Save.
How to Add/Configure a Multi-Version Template
When having the "Search All Versions" option enabled, you can configure your results to show the other versions that contain the keywords the user searched for, by following these steps:
- Navigate to the directory <SmartHub_root>\modules\ContentContainers\templates..
-
Create a new HTML template for results with multiple versions.
-
Use the out-of-the-box template file resultItemWithMultipleVersionsTemplate.html file as an example.
-
Template
<div class="sh-result-item core-result">
<div class="core-result-info-wrapper">
<div class="core-info">
<span class="access-required-lock" style="display:<%= result.accessrequired ? "inline-block" : "none" %>">
<i class="sh-icon-button far fa-lock"></i>
</span>
<a class="sh-title-value sh-result-link analytics-track-openItem" target="_blank" href="<%= result.clickUri %>" title="<%= result.title %>"><%= result.title %>
</a>
</div>
<div class="core-info widgets-placeholder">
<div class="sh-field-value sh-result-item-summary">
<div><%= result.excerpt %></div>
</div>
</div>
<% var hasMultipleVersions = false;
if (result.Versions) {
var versions = JSON.parse(result.Versions);
if (versions.Count > 1 && versions.Versions)
hasMultipleVersions = true;
}
if (hasMultipleVersions) { %>
<div class="core-info versions-info">
<div class="versions-header" style="padding-bottom: 10px;" onClick="SH.$('.versions-content-<%= result.index %>').toggleClass('hidden'); SH.$('.versions-header-arrow-<%= result.index %>').find('i').toggleClass('fa-angle-down fa-angle-up')">
<div class="versions-header-text" style="display: inline; padding-right: 10px; font-weight: bold;">Other versions</div>
<div class="versions-header-arrow-<%= result.index %>" style="display: inline;"><i class="fas fa-angle-down"></i></div>
</div>
<div class="versions-content-<%= result.index %> hidden">
<% versions.Versions.forEach (function (version) {
if (version.Search && version.Search.Hit === true) {
var newUrl = result.clickUri.substring(0, result.clickUri.indexOf("&ver=") + 5) + version.Label;
var isCurrent = version.Label === result.clickUri.substring(result.clickUri.indexOf("&ver=") + 5); %>
<div class="version-item" style="padding-bottom: 10px;">
<a href="<%= newUrl %>"> <%= newUrl %> <%= isCurrent ? " (current)" : "" %></a>
<div class="open-preview-version-button sh-float-right" onClick="if(typeof BAInsight.DocumentViewer !== "undefined" && BAInsight.DocumentViewer._isMobile) {clearTimeout(BAInsight.LongitudePreview.HoverTimeoutId);} BAI.SmartPreviews.ShowDocumentPreview("<%= encodeURIComponent(newUrl)%>", "<%= encodeURIComponent(newUrl)%>", "<%=encodeURIComponent(result.title)%>", "<%=Coveo.state(SH.utils.getSearchRoot(), "ql")%>", SH.SmartPreviews.Options)">
<i class="sh-icon-button far fa-eye"></i>
<span>Preview version</span>
</div>
</div>
<% } %>
<% }) %>
</div>
</div>
<% } %>
<div class="sh-action-bar core-action-bar">
<a class='sh-result-link prettyURL sh-float-left' target="_blank" href="<%= result.clickUri %>" data-interception="off">
<span title="<%= (result.filetype||'document') + " from " + (result.contentsource || result.clickUri || 'Source') %>"><%= (SH.utils.getSourceSystemImage(result.clickUri, result.ContentSource) || result.ContentSource) %></span>
<span title="<%= result.clickUri %>"><%= SH.utils.prettifyURL(result.clickUri) %></span>
</a>
<div class="open-preview-button hidden sh-float-right" <% if(result.accessrequired) { %> style="display:none !important" <% } %> >
<i class="sh-icon-button far fa-eye"></i>
<span>Preview</span>
</div>
</div>
</div>
</div>
Tip! The code block above is just an example.
-
Modify and style the template to contain information as you desire.
-
Take the appropriate settings from the DefaultModuleSettings.js file (<SmartHub_root>\modules\SmartHubResourceLoader\DefaultModuleSettings.js), and copy them into your custom settings file.
-
Use <SmartHub_root>/modules/SmartHubResourceLoader/CustomSettingsTemplate.js as a template to create your custom settings file.
-
Change the ItemTemplatePicker setting to use the template created at step 2.