You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/general-development/keyword-query-language-kql-syntax-reference.md
+20-4Lines changed: 20 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Keyword Query Language (KQL) syntax reference
3
3
description: Describes how to construct KQL queries for Search in SharePoint and steps on how to use property restrictions and operators in KQL queries.
4
-
ms.date: 03/09/2023
4
+
ms.date: 04/16/2023
5
5
ms.assetid: d8489f59-522f-433c-b9c1-69e597be51c7
6
6
ms.localizationpriority: high
7
7
---
@@ -390,7 +390,6 @@ Matches would include Microsoft Word documents authored by John Smith. This is t
390
390
`author:"John Smith" AND filetype:docx`
391
391
392
392
393
-
394
393
### Grouping property restrictions within a KQL query
> `title:page` return matches with the exact term *page* while `title:(page)` also return matches for the term *pages*.
431
430
432
431
432
+
### Filter on items where a property is empty or contains a value
433
+
_**Applies to:** Office 365 | SharePoint Online_
434
+
435
+
For managed properties in the search schema which are set to be [Queryable](https://msdn.microsoft.com/library/Microsoft.Office.Server.Search.Administration.ManagedProperty.Queryable.aspx) you can use the wildcard operator (*) as the property expression to filter on items which either have a value or does not have a value.
436
+
437
+
Syntax to return items where a property has a value:
438
+
439
+
`<Property Name>:*`
440
+
441
+
Syntax to return items where a property does not have a value:
442
+
443
+
`NOT <Property Name>:*`
444
+
445
+
The following example will return sites which are associated to a hub site, excluding the hub sites themselves:
446
+
447
+
`(DepartmentId:* OR RelatedHubSites:*) AND contentclass:sts_site NOT IsHubSite:true`
448
+
449
+
433
450
## KQL operators for complex queries
434
451
<aname="kql_operators"> </a>
435
452
436
453
KQL syntax includes several operators that you can use to construct complex queries.
0 commit comments