I used Sitecore PowerShell Extensions module to create script, that copy the relation from one item to the related item.
I use Get-ChildItem
to get all the items which will have relation on specific fields
Get-ChildItem -Recurse . | Where-Object {
$_.TemplateName -match $'myTemplate' -and
$_.Fields[$fromfield].Value -ne $null -and
$_.Fields[$fromfield].Value -ne ""
} | ForEach-Object {
}
I took about 1 min to fetch all the items because the data is big.
So I tried to use Find-Item
to make the search process faster
Find-Item -Index 'sitecore_mastre_index' -Where 'TemplateName = @0' -WhereValues 'myTemplate'
It gave me below warning, note that I use Sitecore Version 7.2
WARNING: The parameter Where is not supported on this version of Sitecore due to platform limitations.
This parameter is supported starting from Sitecore Version 7.5
Is there a way to retrieve the data using PowerShell in way faster than using Get-ChildItem
?
Note: if I use Get-Item .
the query returns only the first 100 items. I have many more items.