Searching in PolicyHub
This guide provides an high level technical overview of searching for phrases and word in PolicyHub.
Searching in PolicyHub can be divided into two parts, these are
- Searching for document name and versions, or the properties of a document.
- Searching for words and phrases, or the content of a document
Searching for a string in a document name or searching for a revision number is carried out using the stored procedure 'uspFSM_SearchInbox'. The stored procedure searches for the strings against the PolicyHub database.
Searching for a string in the content of the document uses the uspDBFSM_SearchDocument stored procedure to query the PolicyHubCatalog full text catalog. The full text catalog is populated by the SQL Full-text Filter Daemon, in order for the daemon to read the content of the documents, interops have to be installed. Interops for Microsoft Office documents are already installed with SQL. The interop for reading the contents of Adobe PDF files have to be installed manually.
To list the available interops run the following script against the master database.
SELECT * from sys.fulltext_document_types
To query documents using the content of the catalog, the following command can be used.
CONTAINS(FileContent, '"<String>*"', LANGUAGE 2057)
OR FREETEXT(FileContent, '<String>', LANGUAGE 2057)
This came from PolicyHub, the result of this query is the same as running it with the FREETEXT clause. Removing the FREETEXT clause (retaining the CONTAINS clause) could be used to search for phrases instead of combinations of words.