3

I have an issue where using the "Find an item" search function doesn't return all items in my SharePoint Online list.

I have tried all the troubleshooting steps that I can online to no avail such as indexing the columns, ensuring that the items are published and checked in and that content approval is not required on the items.

The list contains around 2500 items, around 2000 of these were migrated from an old SharePoint on premise solution.

The list contains a workflow which runs against each new item in the list which simply updates the reference number of the item. The workflow is only run on new items, as the items migrated already had reference numbers associated with them.

Oddly, I have noticed that the items that were appearing in the search results were only those that had the workflow completed against them.

For example, if you were to search for Copper only 3 results would be returned when I was expecting over 20:

enter image description here

When I located an item that hadn't had the workflow ran against it that began with "Copper" (Copper Sulphate), I re-ran the workflow, and sure enough, after re-indexing the list and waiting a few minutes, it appeared in the search results:

enter image description here

If anyone is able to help me with this it would be greatly appreciated, I know I could run a a Powershell script against the list to run the workflow against each item, but I'd rather understand whats causing this issue first.

Let me know if you need any more info, thanks in advance.

SOLVED

Thanks to @Hellofiona_MSFT who replied in the comments who suggested I simply edit and save items in the list as migrated items wont be being picked up in the search. To do this for the few thousand items in the list I wrote a (crude) Powershell script that creates a column in the list called "Modify". The script then iterates through each item in the list and sets the column modify to "YES" so simulate me editing the items and saving them. I then deleted the column, all of the results now appear in the search. You can see the Powershell below. I'd love a better understanding of why this happens, but I am happy with the fix for now. Hope this helps someone else!

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

#Variables for Processing
$SiteURL="Sharepoint URL"
$ListName= "List name"

Try {
    #Get Credentials to connect
    $credential = Get-Credential
    $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($credential.UserName, $credential.Password)

#Setup the context
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Ctx.Credentials = $Credentials

#Get the List
$List = $Ctx.Web.Lists.GetByTitle($ListName)

$ShemaXml = "<Field DisplayName='Modify' Type='Text' />";

$List.Fields.AddFieldAsXml($ShemaXml,$true,[Microsoft.SharePoint.Client.AddFieldOptions]::AddFieldToDefaultView)

$qry = [Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery()

$items = $list.GetItems($qry)

$Ctx.load($items)
$Ctx.ExecuteQuery()

foreach ($item in $items)
{

$editor = $item["Editor"];
$modified = $item["Modified"]

#Update Modify Column to Yes and keep the modified by and date the same
$item["Modify"] = "YES"; 
$item["Editor"]= $editor;
$item["Modified"] = $modified; 
$item.Update() 

$ctx.ExecuteQuery()

write-host $item.Id $item.FieldValues.Title -ForegroundColor Green

} 



}
Catch {
    write-host -f Red "Error" $_.Exception.Message
}
  • You can check if all the migrated items cannot be search, it might need to update for migrated items even without any change, just edit->save. – Hellofiona_MSFT Jan 25 at 7:49
  • Hi, I'll try this and let you know if it works! – David Buckley Jan 25 at 9:13
  • 1
    @DavidBuckley We fixed your flagged issue with privacy on images in previous edits. They have been removed from edit history. – Benny Skogberg Jan 26 at 9:54
2

Repeat the full crawl of the root collection, configure the round and full bypass periods at the intervals you need.

  • Hi, thanks for the response. I tried the above and waited and have not seen any improvement. It still appears the search is being affected by the worfklow status. – David Buckley Jan 25 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.