Keyword query language KQL in SharePoint 2013

This SharePoint tutorial, we will discuss Keyword query language (KQL) in SharePoint 2013 search.

In SharePoint 2010, there are 3 types of languages supported for Search queries.

  • SQL query
  • FAST Query Language (FQL)
  • Keyword Query Language (KQL).

But in SharePoint 2013 Microsoft removed SQL query fully. So if you have any solution in SharePoint 2010 which uses SQL query, and if you are trying to migrate to SharePoint 2013, then you should rewrite and then migrate.

FAST Query Language (FQL) is used with the FAST search product. But Microsoft is not recommending to use FQL in development, neither for end users. You should use Keyword Query Language (KQL) in SharePoint 2013 for end-users or for developers also. You can directly enter KQL queries in the search center, also you can append to a Search Center URL or you can use in the definition of result sources or also you can programmatically to any search API if you are trying to call.

Keyword query language (KQL) in SharePoint 2013

In KQL you can search using free text queries and the search engine look in the Index for the matching terms. These terms include any text from the body of the document as well as any managed property whose searchable attribute is true. These free-text queries are case insensitive and are limited to 2048 characters. You can also search for complete phrases by using double-quotes.

Few Examples of Free Text and Managed Properties: (Search Term: Description)

  • SharePoint: This will for the search for items that contains term SharePoint in the index.
  • SharePoint API: Searches for items containing both the words SharePoint AND API, but not in any particular order
  • SharePoint API: Searches for items containing the exact phrase “SharePoint API”.
  • SharePoint*: Searches for items containing terms that begin with SharePoint
  • Title: SharePoint -> Searches for items whose Title contains the specified value SharePoint.
  • FileExtension=docx -> Searches for items whose FileExtension equals to docx.
  • FileExtension<>pdf -> Searches for items whose FileExtension not equal to pdf.

KQL also supports Boolean operators, proximity operators, synonym operators, and ranking operators in search queries.

  • Title: SharePoint OR Title: API -> Searches for items whose Title equals to SharePoint or Title is equal to API.

You may like following SharePoint search tutorials:

Here, we learned Keyword query language (KQL) in SharePoint 2013.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>