Trying use Find-Item
to get all items where _Source
has a value set. Normally the _Source
is null, so I thought that this would be sufficient - check for $null
with -Invert
set:
$FilterCriteria = @(
@{Filter = "Equals"; Field = "_Source"; Value = $null; Invert=$true },
@{Filter = "StartsWith"; Field = "_fullpath"; Value = "/sitecore/content/Website/sitex" }
)
$itemsToProcess = Find-Item -Index "sitecore_master_index" -Criteria $FilterCriteria -First 10 | Initialize-Item
It isn't working... Then I thought that I could use "contains" as filter for _Source-field
, as the field starts with a "sitecore..."-string if set:
$FilterCriteria = @(
@{Filter = "Contains"; Field = "_Source"; Value = "sitecore" },
@{Filter = "StartsWith"; Field = "_fullpath"; Value = "/sitecore/content/Website/sitex" }
)
$itemsToProcess = Find-Item -Index "sitecore_master_index" -Criteria $FilterCriteria -First 10 | Initialize-Item
Nothing seems to be working on the "_Source"-field - any clues to make this work?!?