"AllVersions" versionFilter in PerformSearchAPI returns unexpected results

Hello community folks!

Has anyone used the "AllVersions" versionFilter when executing a search query? We have a search that currently looks at only the latest versions of the documents to match it with the rest of the search criteria but we now need to fetch all documents irrespective of it's version. When we run the search query with "AllVersions", it brings back documents that do not match the search criteria. One pattern we noticed in some cases is that it always brought a version older than the one that we expected. For example, if we just release version 2 of a document and then run the search query with the time window it brings back version 2 in response but also shows version 1 in the response. Is there some sort of a relationship between consecutive versions such that when a newer version is released it marks some internal state of previous version of that document and hence it shows up in the search results.

Thank you in advance!

-Dhruv

Parents
  • Hi Dhruv,

    It is hard to predict the actual query and hence the unexpected behavior from the information supplied above in teh question.

    However let met try to answer your question with the following assumptions.

    1/ You try to run a query that filters the results based upon the MODIFIED-ON field which is limited to a certain range.

    2/ You update the FSTATUS field of a version 2 object so that this object becomes 'Released'

    In this case, the search will indeed return both version 1 and version 2 of the object as being modified as there is indeed an internal field which helps to identify the latest released version of an object.
    This is the FISHSTATUSTYPE field

    The behavior of the field is described on the following documentation page from our Documentation Portal: https://docs.sdl.com/806356/68224/sdl-tridion-docs-14-sp3/understanding-status-filters

    The update of the version 1 FISHSTATUSTYPE field towards the value '30' will mark this as being updated, hence the match in the query

    I hope this helps explaining the unexpected results.

    Kind Regards,

    Raf

  • I agree with Raf's analysis without seeing the "actual ishquery" you are launching.

    The MODIFIED-ON field tracks any change on the card (logical, version, language), also changes from system fields. System fields changes could come from within the system to track, but also from custom configurations like IWrite-event-plugins.

    There are however other MODIFIED-ON fields you could use. You can find all fields, usage and description using PowerShell module ISHRemote

        Get-IshTypeFieldDefinition | Out-GridView

    shows you a grid, where you can filter on "DateTime" as field data type.

    The field I would consider here is FISHLASTMODIFIEDON, it tracks the date/time of the last change to the binary, so in practice the *.XML, *.JPG,... that was attached to the language level.

    What is also appreciated is to make your question a bit handson with an actual example query, perhaps logging and the product version also holds a lot of information how a certain system (should) behave.

    -Dave

  • Hello Raf and Dave!

    Thank you so much for your replies on my post. My apologies for not including the request and posting an incomplete question, please find the failing request below:

    <ishquery>
        <and>
            <ishfield name='FSTATUS' level='lng' ishoperator='equal'>Released</ishfield>
            <ishfield name='MODIFIED-ON' level='lng' ishoperator='greaterthanorequal'>04/03/2021 21:59:10</ishfield>
            <ishfield name='MODIFIED-ON' level='lng' ishoperator='lessthan'>04/03/2021 22:03:10</ishfield>
        </and>
        <ishobjectfilters>
            <ishversionfilter>AllVersions</ishversionfilter>
            <ishtypefilter>ISHModule</ishtypefilter>
            <ishtypefilter>ISHLibrary</ishtypefilter>
            <ishtypefilter>ISHMasterDoc</ishtypefilter>
        </ishobjectfilters>
    </ishquery>

    if I am not wrong, the "FISHSTATUSTYPE" is available only for Publication Object and not the other objects that I am searching for. Our search only looks for changes made to IshModules, IshLibrary and IshMasterDoc.
    I tried updating my query above to use "FISHLASTMODIFIEDON" instead of "MODIFIED-ON" but it did not come back with any records but if I use the same time window with "MODIFIED-ON" I get back records.. The plugin write column for that field here says NO, so is it possible that we might not be persisting that field as part of our plugins or is this something that SDL would manage?

    Thanks,

    Dhruv

Reply
  • Hello Raf and Dave!

    Thank you so much for your replies on my post. My apologies for not including the request and posting an incomplete question, please find the failing request below:

    <ishquery>
        <and>
            <ishfield name='FSTATUS' level='lng' ishoperator='equal'>Released</ishfield>
            <ishfield name='MODIFIED-ON' level='lng' ishoperator='greaterthanorequal'>04/03/2021 21:59:10</ishfield>
            <ishfield name='MODIFIED-ON' level='lng' ishoperator='lessthan'>04/03/2021 22:03:10</ishfield>
        </and>
        <ishobjectfilters>
            <ishversionfilter>AllVersions</ishversionfilter>
            <ishtypefilter>ISHModule</ishtypefilter>
            <ishtypefilter>ISHLibrary</ishtypefilter>
            <ishtypefilter>ISHMasterDoc</ishtypefilter>
        </ishobjectfilters>
    </ishquery>

    if I am not wrong, the "FISHSTATUSTYPE" is available only for Publication Object and not the other objects that I am searching for. Our search only looks for changes made to IshModules, IshLibrary and IshMasterDoc.
    I tried updating my query above to use "FISHLASTMODIFIEDON" instead of "MODIFIED-ON" but it did not come back with any records but if I use the same time window with "MODIFIED-ON" I get back records.. The plugin write column for that field here says NO, so is it possible that we might not be persisting that field as part of our plugins or is this something that SDL would manage?

    Thanks,

    Dhruv

Children
  • Hi Dhruv,

    The FISHSTATUSTYPE is an internal field available for the following object types: 'ISHModule', 'ISHLibrary', 'ISHMasterDoc','ISHIllustration','ISHTemplate' and 'ISHPublication'. So on ALL object types.

    You might be confused by the FISHPUBSTATUS which is only available on the object type 'ISHPublication'.

    You can verify this by using ISHRemote and follow the procedure below:

    1. Create a new session linked to your environment

    $mySession = New-IshSession -WsBaseUrl https://<your machine reference>/ISHWS -PSCredential Get-Credential

    2. Provide the username/password combination (of an administrative user) in the popup window

    3. Request to retrieve all field defintions

    Get-IshTypeFieldDefinition | Out-GridView

    4. In the Gridview popup window filter based upon the value FISHSTATUSTYPE (put this in the textbox with the placeholder text 'filter'.

    The result should be as shown below which shows that the field FISHSTATUSTYPE is available on all 6 object types listed above (foreach object type it is available on the language level)

    PowerShell window showing a command to retrieve field definitions in Trados Studio, with a GridView popup displaying the FISHSTATUSTYPE field available for various object types.

    I hope this helps,

    Kind Regards,

    Raf

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 6:44 AM (GMT 0) on 5 Mar 2024]
  • Hello Raf,

    Thank you so much for your prompt reply with clarification, I was indeed confusing it FISHPUBSTATUS. Let me update my query and see how it goes.

    Thanks,

    Dhruv