Question

I am trying to make an Highlighted content with Custom Query. The content type is Announcement and the filter should be when the Expires field is empty or has a date >=Today.

I struggle with the filter. I have used NOT and I have used OR to correlate the when field is empty OR when the date is in the future.

What is the right syntax?

Était-ce utile?

La solution

The default managed search column for the "Expires" site column is ExpiresOWSDATE, so, unless you've gone into the Search Schema settings in the SharePoint Admin Center and changed the Managed Column definition, your query should look like:

ExpiresOWSDATE="" OR ExpiresOWSDATE>=today

Autres conseils

Per my test the expire date column of announcement is mapped to the managed property expiration time.

Here is a query which works, please have a try

-ExpirationTime:1900-01-01..{Today}  contentclass:"STS_ListItem_Announcements" 

As far as I know there is no way to search against null values, since these are not stored in the index. That is why you cannot use an AND to get the required query

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top