Forum Discussion
Submit-PnpSearchQuery Filter on Date
- Mar 18, 2024
Correction... that wasn't returning quite the right results also... however... this is:
$SearchQuery = "(NOT RefinableDate01>1900-01-01 Path:" + $SiteURL +"/Reports/)"This was a useful resource:
https://www.techmikael.com/2023/04/filter-on-managed-properties-in-search.html
You have to use the managed property associated with your list column, DO NOT use internal column name with SharePoint search.
Steps to map list column with managed property in SharePoint Online: How to sort by name with the Highlighted Content Web Part?
Related documentations:
- Overview of crawled and managed properties in SharePoint Online
- Manage the search schema in SharePoint
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
I am using the internal name. It's why I create my fields without spaces first and then rename them later so you don't end up with all that extra junk. As you can see in the URL... I am using the internal name "ReportRun".
Search web parts work fine. I am trying to use PowerShell to find all the files with missing data so I can kick off a task to have Syntex re-process them so the field can get populated.