I am looking for a master index query that will return the latest version of any item. In the solr index there is a field call _latestversion
. But when I add that to my query, I get the error
Find-Item : No property or field '_latestversion' exists in type 'SearchResultItem'
Here is my query
$items = Find-Item -Index sitecore_master_index -Where '(TemplateId=@0 Or TemplateId=@1) And Path.Contains(@2) And _latestversion=true' -WhereValues $clubTemplateId, $wogTemplateId, $roothPath | Initialize-Item
I could use a Get-Item for each result, but that is overkill.