8

I have some code running on version 5.2 SP1 which uses the TDS.Search class. It sets the search instruction as an XML string (using SetSearchInstruction) and gets results as an XML string (using GetSearchResults). I know the CMS internal Search Engine changed with 2011, so was wondering if this code will still work (as the COM API is still available), or if I can expect to tweak the XML of my search instruction to a new format. If tweaking is required, is the new format documented anywhere?

  • I am pretty sure that there were steps taken here for backwards compatibility... but not 100% sure. If you want to send me one or two of your searches I'll give it a quick try in 2011. – Nuno Linhares Mar 12 '13 at 6:21
10

I don't think the XML format is documented anywhere (at least I could not find it) but following Nuno's comment I ran a simple VBscript to check. It seems that the main features that I need are compatible and work unaltered:

  • Search on a particular (metadata) field using the IN operator
  • Search in location
  • Based on schema
  • Type (component)
  • Modified between dates

For reference, this is my search XML string:

<tcm:SearchInstruction xmlns:tcm='http://www.tridion.com/ContentManager/5.0' 

xmlns:xlink='http://www.w3.org/1999/xlink'>
    <tcm:GeneralParameters>
        <tcm:SearchQuery>(United IN location)</tcm:SearchQuery>
        <tcm:SearchIn xlink:href='tcm:0-1-1' Recursive='1'/>
    </tcm:GeneralParameters>
    <tcm:AdvancedParameters>
        <tcm:Type>16</tcm:Type>
        <tcm:BasedOnSchema>
            <tcm:Schema xlink:href='tcm:1-6258-8'>
        </tcm:BasedOnSchema>
        <tcm:Modified>
            <tcm:BetweenDates>
                <tcm:StartDate>1900-01-01T00:00:00</tcm:StartDate>
                <tcm:EndDate>2012-05-01T00:00:00</tcm:EndDate>
            </tcm:BetweenDates>
        </tcm:Modified>
    </tcm:AdvancedParameters>
</tcm:SearchInstruction>

Of course, as with any bespoke code using the API, they key is to test it thoroughly to check it still works (especially as the upgrade covers several versions).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.