How to find all image objects with multi-language set to it, using ishremote?

I'm trying to use ishremote to FIND all images objects in TridionDocs, which the field DOC-LANGUAGE's value is multiple value (e.g. "zh_CN, en_US, es") rather than single value (e.g. "zh_CN").

If I use Set-IshMetadataFilterField -Name 'DOC-LANGUAGE'-level 'Lng' -ValueType 'Value' -FilterOperator 'In' -Value 'zh_CN, en_US, es', the image object with single language value will also be returned, which is not expected.

Due to we now have a large quantity of image objects with multivalue DOC-LANGUAGE, fetch the whole image objects then inspect every object's  DOC-LANGUAGE property, is actually time-consuming.

Is there any good advices on composing powershell scripts?

emoji
Parents Reply Children
  • Hi ... Perhaps best to avoid direct Solr calls as you in turn skip business logic, security and more

    But what about :) 

    $xmlQuery = @"
        <ishquery>
          <and>
            <ishfield name='DOC-LANGUAGE' level='lng' ishoperator='equal'>en</ishfield>
            <ishfield name='DOC-LANGUAGE' level='lng' ishoperator='equal'>de</ishfield>
          </and>
          <ishsort>
            <ishsortfield name='ISHSCORE' level='none' ishorder='d'/>
            <ishsortfield name='FTITLE' level='logical' ishorder='d'/>
          </ishsort>
          <ishobjectfilters>
            <ishversionfilter>AllVersions</ishversionfilter>
            <ishtypefilter>ISHIllustration</ishtypefilter>
            <ishlanguagefilter>en</ishlanguagefilter>
          </ishobjectfilters>
        </ishquery>
    "@
    (Search-IshDocumentObj -XmlQuery $xmlQuery -MaxHitsToReturn 100).doclanguage
    

    emoji