Improving TWSearch performance

If you experience performance issues with the TWSearch JavaScript API, enable Federated Data Repository process indexing and configure TWSearch to search data from the Federated Data Repository.

  1. Enable Federated Data Repository process indexing as described in Enabling the Federated Data Repository process indexing.
  2. Configure TWSearch to search data from the Federated Data Repository instead of the relational database by setting <use-fdr-for-twsearch> in the related 100Custom.xml file (see Location of 100Custom configuration files) as follows:
    <properties>
        <common merge="mergeChildren">
            <search-execution merge="mergeChildren">
                <use-fdr-for-twsearch merge="replace">true</use-fdr-for-twsearch>
            </search-execution>
        </common>
    </properties>

Considerations when setting <use-fdr-for-twsearch> to true

  • When <use-fdr-for-twsearch> is set to true, the TWSearch JavaScript API does not return system tasks. Only human tasks and external activities can be searched by using the TWSearch JavaScript API.
  • If you query process instance status, completion date, or last modification date using the TWSearch JavaScript API, note that the values returned from the Federated Data Repository might not be accurate. By default, for performance reasons, tasks documents associated with completed tasks are not updated anymore when a change occurs at the process instance level. To ensure accurate values for these fields in the search results, use the TWSearch.executeForProcessInstances() method. This method first identifies matching process instances by running an internal search against the Federated Data Repository process index, and then retrieves the data for each matching instance from the relational database.
  • Searches against the Federated Data Repository can be affected by limitations configured in the Elasticsearch or OpenSearch instance that is used as the Federated Data Repository. For example, the index.max_result_window property defines the maximum from + size value for index searches, where from is the starting offset and size is the number of results to return. The default value is 10000.