# SharePoint KQL Search Syntax: Operators and Examples

> For the full documentation index, see https://250highstreet.com/llms.txt

> SharePoint KQL search syntax: free-text words and phrases, property restrictions like filetype:docx, and the uppercase AND, OR and NOT operators.

As of November 2026, a SharePoint KQL query is made of free-text words or phrases, property restrictions, and the operators that join them. Microsoft's reference calls the language KeyQL; operators such as AND, OR and NOT must be uppercase, while the query itself is case-insensitive.

## How do words and phrases behave?

Several words with no operator between them behave as if joined by AND. A phrase needs double quotation marks, and then only items with the words next to each other match.

Words match exactly against the full-text index. A trailing wildcard (*) gives prefix matching. Microsoft says a wildcard cannot lead a word or phrase.

## What do property restrictions look like?

| Query | Returns |
|---|---|
| author:"John Smith" | Items authored by John Smith |
| filetype:docx | Word documents |
| filename:budget.xlsx | Items with the file name budget.xlsx |

## Why does a space break a restriction?

A property restriction must have no white space between the name, the operator and the value. With a space, as in author: "John Smith", SharePoint reads it as free text and searches for the terms author and John Smith.

## Which operators join terms?

| Operator | What it does | Example |
|---|---|---|
| AND or + | Both terms must match | budget AND 2026 |
| OR | Either term can match | TV OR television |
| NOT or - | Leaves out a term | budget NOT draft |
| NEAR(n) | Terms within n words, in any order. Default 8 | "acquisition" NEAR(n=3) "debt" |
| ONEAR(n) | Same as NEAR, but the order must match | "acquisition" ONEAR "debt" |
| WORDS | Treats terms as synonyms for ranking | WORDS(TV, Television) |

## Which operators work on properties?

The colon and equals operators match values. Less than, greater than, their or-equal forms, and a range written A..B work on date and number properties. The not-equal operator (<>) also works on text. The range includes both ends.

## Which date words can you use?

- today, yesterday, this week, this month, last month, this year, last year.
- Put quotes around names with a space, as in LastModifiedTime="this year".
- Fixed dates use the form YYYY-MM-DD, in UTC.

## How do you group a property?

Parentheses can hold several values for one text property, as in author:("John Smith" "Jane Smith"). Microsoft says grouping can match more items, because individual words are lemmatized. Add NOT to find items with an empty property, as in NOT Property:*.

## When search returns nothing

To restrict on a crawled property, Microsoft says it must first be mapped to a managed property. If results are missing, read [SharePoint search not finding documents](/guides/sharepoint-search-not-finding-documents/). For library structure that makes search easier, see [document management best practices](/guides/sharepoint-document-management-best-practices/).

## FAQ

### Is KQL case-sensitive?

The query text is not. Operators like AND, OR and NOT must be uppercase.

### How long can a query be?

In the default SharePoint search front end the limit is 2,048 characters. Programmatic queries default to 4,096.

### Can I put a wildcard at the start?

No. Microsoft says a leading wildcard is not supported.

### How do I search a date range?

Use the .. operator on a date property. A..B includes both A and B.

### What is the difference between NEAR and ONEAR?

NEAR matches terms close together in any order. ONEAR needs them in the order you typed.

### Do date keywords like today work?

Yes. Microsoft lists today, yesterday, this week, this month, last month, this year and last year.

### Can I find items where a property is empty?

Yes. For queryable text properties, use NOT followed by the property name and a colon with an asterisk.

### Does a space after the colon matter?

Yes. With a space, SharePoint treats it as free text, not a property restriction.

## Sources

- [Keyword Query Language (KeyQL) syntax reference](https://learn.microsoft.com/en-us/sharepoint/dev/general-development/keyword-query-language-kql-syntax-reference)

## Related guides

- [SharePoint search not finding documents](/guides/sharepoint-search-not-finding-documents/)
- [SharePoint Document Management Best Practices](/guides/sharepoint-document-management-best-practices/)
- [SharePoint Knowledge Base With an FAQ and Glossary](/guides/sharepoint-knowledge-base/)
- [How to get a SharePoint permissions report](/guides/sharepoint-permissions-report/)
- [How a SharePoint retention policy works](/guides/sharepoint-retention-policy/)

Source: https://250highstreet.com/guides/sharepoint-kql-search-syntax/
