Kentico CMS 7.0 Developer's Guide

SQL search overview

SQL search overview

Previous topic Next topic Mail us feedback on this topic!  

SQL search overview

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

The SQL search is an obsolete search engine for documents in the content tree of websites (pages). We highly recommend using the index-based Smart search instead. The system continues supporting the SQL search for the following reasons:


Backward compatibility with older versions

Searching files uploaded as document attachments


This search engine uses standard SQL queries to search for expressions:


The system automatically generates queries for the data of individual document types. To override the search query for a document type, create a new query named searchtree in Site Manager -> Development -> Document types -> Edit document type -> Queries.

The cms.root.searchdocuments query searches fields that are shared by all documents (such as the document name).

The cms.root.searchattachments query searches files uploaded as document attachments. To search attachments, you need to configure the system as described in Configuration of full-text search in files.


Adding the SQL search onto your website


To integrate the SQL search into website pages, use the web parts in the Full-text search category (SQL search dialog, SQL search box, etc.) or the CMSSearchDialog and CMSSearchResults server controls (in your ASP.NET code).


Excluding documents from search


You can exclude document types by setting the Exclude document types from SQL search value in Site Manager -> Settings -> System -> Search. You need to enter the code name, such as cms.article. You can enter multiple document types separated by semicolons (;).


You can exclude website sections from the search by setting the Exclude documents from SQL search value in Site Manager -> Settings -> System -> Search:


To exclude a single document, enter the alias path, for example: /news/news1

To exclude entire website sections, enter a path expression, for example: /news/%.


You can enter multiple values separated by semicolons (;).


To directly exclude individual documents from the SQL search:


1.Select the document in the content tree in CMS Desk.

2.Go to Edit -> Properties -> Navigation.

3.Check Exclude from search.

4.Click Save.


Modifying the search result format


If you wish to modify the format of the SQL search results, modify the searchresults transformation in Site Manager -> Development -> Document Types -> edit (Edit) Root -> Transformations.


Development of Custom Search Provider


If you need to integrate a custom search engine or make additional modifications to the search results returned by the SQL search engine, you can develop your own search provider. You can find more details in API programming and Kentico CMS internals-> Custom providers -> Custom Search Provider.