Crawl time is stored in a crawled property named 323 in the Internal category. By default this crawled property is not visible in the schema, but if you create it, you can use it.
On-premises 2013The script below will create the crawled property needed for crawl time, create a managed property called CrawlTime, and then map them. Next time you crawl an item you can get the crawl time value on an item….. very useful for troubleshooting without having to go to the crawl log to find the time it was crawled. You can modify the script below if you want to sort and query on CrawlTime to make the managed property queryable and sortable.
$ssa = Get-SPEnterpriseSearchServiceApplication # To be run in a SP Management Shell $cp = New-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $ssa -PropSet 012357BD-1113-171D-1F25-292BB0B0B0B0 -Category Internal -VariantType 0 -Name 323 -IsNameEnum $true $mp = New-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $ssa -Name CrawlTime -Type 4 -Retrievable $true -FullTextQueriable $false New-SPEnterpriseSearchMetadataMapping -SearchApplication $ssa -ManagedProperty $mp -CrawledProperty $cp
SharePoint OnlineIf you’re not getting back data for CrawlTime, you can perform the below steps:
- Download CrawlTimeSchema.xml from https://github.com/wobba/SearchConfiguration
- Navigate to https://
- Click Import Search Configuration
- Choose the schema file you downloaded
- Click Import
You will now have a managed property named CrawlTime of type Text with the last crawl date. The reason for text is that SPO doesn’t allow creating of new managed properties of type Date.
If you want to query or sort on the property, you can map the crawled property Internal:323 which is now available to for example RefinableDate00.