Search definition file for export

The search definition file for export defines which content is to be exported from an ImageMaster repository. The following search methods can be applied within the export definition file:

  • searchLatestRevisionByKey

    The keys are combined by the AND operator. The keys to search for are either attributes or linked attributes.

  • searchAllRevisionsByKey

    The keys are combined by the AND operator. The keys to search for are either attributes or linked attributes.

  • searchLatestRevisionByDocumentId

  • searchAllRevisionsByDocumentId

  • searchByRevisionId

  • searchByQuery (See additional remark Search by query with unexpected side effects below.)

The example snippet in the ending of this chapter demonstrates the usage within a search definition file (export.xml).

Search by query with unexpected side effects

Search queries are internally managed in segments based on the parameter “pagesize” (see Command line commands and parameters). If a query returns more results than the value of “pagesize”, it means that multiple search requests are being sent, each returning a segment of the overall results. If during the FIS export the result set of the query changes, this can cause an unexpected outcome.

The result set of the query can change if during the FIS export new documents are created that match the search query or if existing documents are changed or deleted so they do not match the search query anymore. As an unexpected outcome, documents can be missing from such a FIS export or duplicates of the same document can exist in such a FIS export.

To avoid an undesired outcome of a FIS export, you can follow either one of these approaches:

  • Implement a strategy where you first identify all relevant documents (based on revision or document IDs) with some other query, and then use this list of IDs in the export.

  • Make sure that the query only targets documents for which the result set does not change during the export. For example:

    • Schedule the export at some time outside of the business hours, when no changes are expected.

    • Identify search criteria that only target documents for which you can ensure that they are not changed. For example, restrict the search to items last edited before the current date and time or based on some date in the past.

  • Apply a sorting order in your query based on the RAQL combinator “order” according to the section RAQL base combinators in the system manual [SM IS].

    In this approach make sure that your order is based on an attribute for which an index has been created in the database to avoid performance issues or long-running queries that can fail due to a timeout limit.

  • If this can be calculated in your situation, make sure that the expected number of search results is always less than the value of the parameter “pagesize”, so choose a large enough value for pagesize in your FIS configuration.

    Note that a too large value of pagesize may not be desired either, since this can result in long-running queries that fail due to a timeout limit. If in doubt, consult with T-Systems.

Search IDs

The search IDs, which are used in the definition file “export.xml”, will be used in the resulting export as designators within subdirectory names (see chapter Export directory structure) and they will also be included as attribute values of the element “<searchResult...>” within the resulting xml files (see Example export files), which describe the metadata of exported content. The IDs provide a reference from the exported metadata description files to the belonging content, which has been exported as files.

Search IDs can be omitted in the search definition file by using the search element without an ID attribute:

<search> ... </search>

In this case UUIDs will be generated as search IDs by FIS itself and a new file “export.xml” will be created, while the original input file will be renamed to “export.xml_orig”.

Example search definitions for export

The following XML code presents example search definitions for export, which could be applied in a definition file (export.xml). For details on how to formulate a query, i.e. concerning the “query_string” below, consult the corresponding system manual [SM IS].

Be aware: Copy and paste from an example in this PDF into a text file that shall be processed by FIS can result in errors due to the encoding of special characters that can get broken!

<?xml version="1.0" encoding="UTF-8"?>

 

<tns:operation name="export" xmlns:tns="http://imafis.imaes.ecm.tsystems.com/">

 

  <!--  In the following two cases the result is exactly one revision of a document -->

 

  <search id='06476320-6706-11de-8a39-0800200c9a66'>

    <searchLatestRevisionByKey>

      <attribute name="author">Mario Gomez</attribute>

      <attribute name="team">VFB Stuttgart</attribute>

    </searchLatestRevisionByKey>

  </search>

 

  <search id='06476321-6706-11de-8a39-0800200c9a66'>

    <searchLatestRevisionByDocumentId>

      <documentId>16476320-6706-11de-8a39-0800200c9266</documentId>

    </searchLatestRevisionByDocumentId>

  </search>

 

  <!--  In the following two cases the result includes all revisions of a document -->

 

  <search id='06476321-6706-11de-8a39-0800200c9a66'>

    <searchAllRevisionsByDocumentId>

      <documentId>16476320-6706-11de-8a39-0800200c9266</documentId>

    </searchAllRevisionsByDocumentId>

  </search>

 

  <search id='06476321-6706-11de-8a39-0800200c9a66'>

    <searchAllRevisionsByKey>

      <attribute name="author">Mario Gomez</attribute>

      <attribute name="team">VFB Stuttgart</attribute>

    </searchAllRevisionsByKey>

  </search>

 

  <!--  The result consists of exactly one revision with the provided revision Id -->

  <search id='06476321-6706-11de-8a39-0800200c9a66'>

    <searchByRevisionId>

      <revisionId>16476320-6706-11de-8a39-0800200c9266</revisionId>

    </searchByRevisionId>

  </search>

 

  <!-- The result can be many objects of different types and an unknown number of hits.

   The actual ‘query_string’ must be a RAQL query.

  -->

 

  <search id='56476322-6706-11de-8a39-0800200c9a66'>

    <searchByQuery>

      <language>RAQL</language>

      <query>query_string</query>

    </searchByQuery>

  </search>

 

</tns:operation>