Building search queries in SharePoint

Learn about the search syntax supported in SharePoint for building query rules and search queries.

Supported search syntax in SharePoint for building search queries

SharePoint search supports Keyword Query Language (KQL) and FAST Query Language (FQL) search syntax for building search queries.

Keyword Query Language (KQL)

KQL is the default query language for building search queries. Using KQL, you specify the search terms or property restrictions that are passed to the SharePoint search service.

FAST Query Language (FQL)

FQL is a structured query language that supports advanced query operators. You can use FQL when you want to create complex queries that you want to pass programmatically to the SharePoint search service. FQL isn't intended to be exposed to end users, and is disabled by default.

To enable FQL, use the EnableFQL property. Then, copy the default result source and modify the Query Transformation string {?{searchTerms} -ContentClass=urn:content-class:SPSPeople}, at one of these levels -- Search Service Application (SSA), Site Collection, or Site -- and in one of the following ways:

  • Remove the KQL filter, -ContentClass:urn:content-class:SPSPeople, from the Query Transformation. The resulting Query Transformation string will be: {?{searchTerms}}

  • Replace the Query Transformation string with an FQL equivalent, such as {?andnot({searchTerms},filter(contentclass:"urn:content-class:SPSPeople*"))}.

For more information about result sources and how they work, see to: Understanding result sources and Configure result sources for search in SharePoint.

In this section

See also