CLI: Using AddHashandExtractedText for duplicate detection and text analytics
This document is a companion to CLI: Initial Discovery - File Share . Here you will find advanced instructions for fine-tuning the initial discovery of your file share.
This document is a companion to CLI: Initial Discovery - File Share . Here you will find advanced instructions for fine-tuning the initial discovery of your file share.
Hash values are unique file identifiers. If two or more files have the exact same hash value, they are byte-by-byte the same file.
Open the Cognitive Toolkit by opening a windows command prompt in Administrator Mode
Change directory (cd) to where you extracted the shinydocs-cognitive-toolkit-yyyy-mm-dd.zip file
To see all of the available options for the AddHashandExtractedText tool, use the following command at the Command Prompt:
CognitiveToolkit.exe AddHashandExtractedText --help
A list of Command options will be displayed.
Command options:
Example Commands:
Add hash and text extract for file share
CognitiveToolkit.exe AddHashandExtractedText --index-name shiny --index-server-url http://localhost:9200 --query "AddHashandExtractedText.json" --max-characters 30000
The above command will look at the index shiny (located at http://localhost:9200) for items that match the query in AddHashandExtractedText.json. The tool will reach out to the file share source to generate the hash with MD5 and text extract (if able to) the results of the query up to a maximum of 30,000 characters.
Add hash and text extract for Content Server
CognitiveToolkit.exe AddHashandExtractedText --index-name shiny --index-server-url http://localhost:9200 --source-settings "External Resources\Sample Source Settings\contentserver.json" --query "AddHashandExtractedText.json" --max-characters 30000
The above command will look at the index shiny (located at http://localhost:9200) for items that match the query in AddHashandExtractedText.json. The tool will reach out to the OpenText Content Server source to generate the hash with MD5 and text extract (if able to) the results of the query up to a maximum of 30,000 characters.
Add hash FileNet
CognitiveToolkit.exe AddHashandExtractedText --index-name shiny --index-server-url http://localhost:9200 --source-settings "External Resources\Sample Source Settings\filenet.json" --query "AddHash.json" --action-keyword hash
The above command will look at the index shiny (located at http://localhost:9200) for items that match the query in AddHash.json. The tool will reach out to the FileNet source to generate the hash with MD5 (if able to) for the results of the query.
Text extract for Microsoft SharePoint
CognitiveToolkit.exe AddHashandExtractedText --index-name shiny --index-server-url http://localhost:9200 --source-settings "External Resources\Sample Source Settings\sharepoint.json" --query "TextExtraction.json" --action-keyword text --max-characters 30000
The above command will look at the index shiny (located at http://localhost:9200) for items that match the query in TextExtraction.json. The tool will reach out to the Microsoft SharePoint source to text extract (if able to) the results of the query up to a maximum of 30,000 characters.
Tips
Make your query as specific as possible to the data you want to hash/text extract
If you notice the progress bar is completing in batches of 100 very quickly, this is likely a sign you can increase the --nodes-per-request by an interval of 100