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:
- How to Call SharePoint Search using REST API
- Documents are not showing up in Search Results in SharePoint 2013
- Create and use custom result source in content search web part in SharePoint Online
- Bind SharePoint list data using jQuery datatable using content search web part in SharePoint
- Customize search results by using result types and display templates in SharePoint
Here, we learned Keyword query language (KQL) in SharePoint 2013.
I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SPGuides.com
Download SharePoint Online Tutorial PDF FREE!
Get update on Webinars, video tutorials, training courses etc.