Kentico CMS 7.0 Developer's Guide

Manually configuring full-text search on MSSQL Server

Manually configuring full-text search on MSSQL Server

Previous topic Next topic Mail us feedback on this topic!  

Manually configuring full-text search on MSSQL Server

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

Use the following steps to configure your Kentico CMS database for full-text search in file attachments:

 

1. Start Microsoft SQL Server Management Studio.

oIf you cannot use SQL Server Management Studio on your database server, you can configure the full-text search through a script instead.
 

2. Locate your Kentico CMS database.

 

3. Unfold the Storage sub-folder, right-click Full Text Catalogs and click New Full-Text Catalog.
 
devguide_clip0715
 

4. Type a Full-text catalog name and click OK.
 
devguide_clip0721
 

5. Right-click the new full-text catalog and choose Properties.

 

6. In the Full-Text Catalog Properties dialog, click the Tables/Views tab.

 

7. Assign the CMS_Attachment table to the catalog.

a.Check the box next to the AttachmentBinary column

b.Set the Language for Word Breaker to English or another value

c.Set the Data Type Column to AttachmentExtension

 

devguide_clip0725

 

8. Click OK.
 

You can now search through the content of basic files types stored in the database. See also:

 

Searching PDF files

Searching Microsoft Office documents

 

Enabling attachment search for the SQL search

 

Perform the following steps if you wish to search attachments using the SQL search:

 

 

InfoBox_Exclamation

 

Note

 

The SQL search engine is obsolete. It is recommended to use the Smart search instead. In that case you only need to enable the Search in attachments property of the relevant smart search results web parts.

 

 

1. Sign in to Site Manager and go to Development -> Document types.

2. Edit the Root document type.

3. Open the Queries tab.

4. Edit the searchattachments query and uncomment the following part of the code:

 

SELECT View_CMS_Tree_Joined.*, View_CMS_Tree_Joined.NodeName AS SearchResultName

FROM CMS_Attachment INNER JOIN View_CMS_Tree_Joined

ON View_CMS_Tree_Joined.DocumentID = CMS_Attachment.AttachmentDocumentID

WHERE (##WHERE##) AND

(([AttachmentName] Like N'%'+ @Expression + N'%') OR ([AttachmentTitle] Like N'%'+ @Expression + N'%') OR ([AttachmentDescription] Like N'%'+ @Expression + N'%')) OR (FREETEXT(AttachmentBinary, @expression))

ORDER BY ##ORDERBY##