Skip to main content

I am using a PowerShell script given below

 $indexName = "sitecore_web_index"
    $criteria = @(
                    @{Filter = "Contains"; Field = "industry_sm"; Value = "{7451A225-6450-4D26-BE04-624FD2E63B76}" },
                    @{Filter = "Contains"; Field = "service_sm"; Value = "{0670EE3C-1D07-4172-9ADB-19127D90C180}" }
                )
     $list = Find-Item -Index $indexName -Criteria $criteria | Initialize-Item

It returns a list of all present language versions per item,. Is it possible somehow through the script thatto make it returnsreturn only one language version per item  (enEnglish by default or other if English is not present)?

I am using a PowerShell script given below

 $indexName = "sitecore_web_index"
    $criteria = @(
                    @{Filter = "Contains"; Field = "industry_sm"; Value = "{7451A225-6450-4D26-BE04-624FD2E63B76}" },
                    @{Filter = "Contains"; Field = "service_sm"; Value = "{0670EE3C-1D07-4172-9ADB-19127D90C180}" }
                )
     $list = Find-Item -Index $indexName -Criteria $criteria | Initialize-Item

It returns a list of all present language versions per item, Is it possible somehow through the script that it returns only one language version per item(en by default or other if English is not present)

I am using a PowerShell script given below

 $indexName = "sitecore_web_index"
    $criteria = @(
                    @{Filter = "Contains"; Field = "industry_sm"; Value = "{7451A225-6450-4D26-BE04-624FD2E63B76}" },
                    @{Filter = "Contains"; Field = "service_sm"; Value = "{0670EE3C-1D07-4172-9ADB-19127D90C180}" }
                )
     $list = Find-Item -Index $indexName -Criteria $criteria | Initialize-Item

It returns a list of all present language versions per item. Is it possible somehow through the script to make it return only one language version per item  (English by default or other if English is not present)?

Source Link

Get Only one language version per item by using Find-Item

I am using a PowerShell script given below

 $indexName = "sitecore_web_index"
    $criteria = @(
                    @{Filter = "Contains"; Field = "industry_sm"; Value = "{7451A225-6450-4D26-BE04-624FD2E63B76}" },
                    @{Filter = "Contains"; Field = "service_sm"; Value = "{0670EE3C-1D07-4172-9ADB-19127D90C180}" }
                )
     $list = Find-Item -Index $indexName -Criteria $criteria | Initialize-Item

It returns a list of all present language versions per item, Is it possible somehow through the script that it returns only one language version per item(en by default or other if English is not present)