SharePoint Online crawl/indexing latency

Compared to SharePoint 2013 on premise, working in SharePoint Online can be a little bit like groping in the dark.   To re-index content you can either:

  1. Edit the item
  2. Go to the List Settings –> Advanced settings page and click on the Reindex List button


Then you get to wait around for it to be indexed.  Sometimes that can be quickly, other times not as quick.

While waiting around one day and playing with pulling all the managed properties for my documents I ran into another interesting managed property called CrawlTime.  This one doesn’t come up if you search for it on the Managed Search Schema page, but it is there:


Through some playing around with it I’ve determined that it is a date type property that is retrieve-only which is a bummer because being able to filter or sort your results by the date crawled would be very handy!

Nonetheless, it is better than nothing and applying a little PowerShell we can easily report on the indexing latency.   Like we did for the managed properties, run your query in the Search Query Tool and then copy the json off of the Raw tab.  Then run this in PowerShell:

$obj = ConvertFrom-Json (Get-Clipboard)
$results = $obj.d.query.PrimaryQueryResult.RelevantResults.Table.Rows.results
foreach ($r in $results) {
    $title = ($r.cells.results | ? { $_.key -eq 'Title' }).Value
    $path = ($r.cells.results | ? { $_.key -eq 'Path' }).Value
    $modified = Get-Date ($r.cells.results | ? { $_.key -eq 'Write' }).Value
    $crawled = Get-Date ($r.cells.results | ? { $_.key -eq 'CrawlTime' }).Value
    $delta = $crawled - $modified
    write-host $title
    write-host " Modified: $modified"
    write-host " Crawled: $crawled"
    write-host " Index latency: $delta"

You should get a report that looks something like this:


The first item took a little over an hour to index while the last one was just under 30 minutes.  Note that the ones with the really long delay were indexed by a Reindex List request and therefor the indexing latency isn't applicable (because the items haven't changed so the modified time didn't get updated). 

The PowerShell would be easy to adapt for other purposes.

Another idea I had was to create a tool that would periodically (every 10 minutes?) modify a list item and search for it.  Using the CrawlTime one could build a fairly accurate chart showing SPO indexing latency 🙂

Comments (1)

  1. Mike Morawski says:

    Cool find thanks for sharing!

Skip to main content