Skip navigation links
DFC 23.4

Package com.documentum.fc.client.search

Provides classes and interfaces for constructing and running search queries against multiple content repositories as well as external information sources (optional).

See: Description

Package com.documentum.fc.client.search Description

Provides classes and interfaces for constructing and running search queries against multiple content repositories as well as external information sources (optional). The classes and intefaces of this package are collectively known as the Search Service. The Search Service provides an advanced facility for creating and managing Documentum queries.

The Search Service is built on top of the Federated Search Services (FS2) framework and hides the complexity of dealing with a variety of sources. It provides a unique view of Documentum content repositories and external repositories. It also supports pass-through queries for executing complex DQL queries across multiple content repositories. To get more information about the search functionality, you can refer to the Search Development Guide written by Lani Hardage-Vergeer. This guide is accessible from http://powerlink.emc.com/ (Search "search development guide").

Note: If your needs are simple or if you need explicit control over all phases of query execution you should use IDfQuery directly. If however you want to take advantage of the advanced features of the Search Service you can use the interfaces in this package.

The Search Service provides the following advanced features:


Query definition:

The definition of a query should be performed through IDfQueryBuilder.
Special support for full-text searches is provided:

        IDfQueryBuilder queryBuilder = <DfQueryManager>.newQueryBuilder();
        queryBuilder.addSelectedSource("philo_docbase");
        IDfExpressionSet rootExpressionSet = queryBuilder.getRootExpressionSet();
        rootExpressionSet.addFullTextExpression("Descartes Nietsche Kant");
    

Building a more advanced search with multiple clauses can also be performed:
        IDfQueryBuilder queryBuilder = <DfQueryManager>.newQueryBuilder();
        queryBuilder.addSelectedSource("philo_docbase");
        IDfExpressionSet rootExpressionSet = queryBuilder.getRootExpressionSet();
        rootExpressionSet.addSimpleAttrExpression("authors", IDfValue.DF_STRING,
        IDfSimpleAttrExpression.SEARCH_OP_CONTAINS, true, true, "Descartes");
        rootExpressionSet.addSimpleAttrExpression("object_name", IDfValue.DF_STRING,
        IDfSimpleAttrExpression.SEARCH_OP_DOES_NOT_CONTAIN, true, false, "encyclopedia");
    

Selection of the sources looks like:
        IDfQueryBuilder queryBuilder = <DfQueryManager>.newQueryBuilder();
        queryBuilder.addSelectedSource("philo_docbase"); // a first content repository
        queryBuilder.addSelectedSource("university_docbase"); // a second content repository
        queryBuilder.addSelectedSource("library/LoC"); // an external source
        queryBuilder.addSelectedSource("museum/Smithonian"); // another external source
    


Query execution

The execution of a query is managed through IDfQueryProcessor. It supports two execution modes:

The Search Service returns only a limited number of results. The maximum number of results can be configured in dfc.properties with a maximum number of results per source and a maximum number of results for a search (applying to the set of results from all the selected sources). You can refer to dfcfull.properties to get a detailed description of these properties.


Synchronous search:
    // Establish session and get general query manager
    IDfSearchService searchService = <IDfClient>.newSearchService(<IDfSessionManager>);
    IDfQueryManager queryManager = searchService.newQueryMgr();

    // Create a new query builder for each query
    IDfQueryBuilder queryBuilder = queryManager.newQueryBuilder();
    IDfQueryProcessor processor = searchService.newQueryProcessor(queryBuilder, true);

    processor.blockingSearch(SEARCH_TIMEOUT);

    IDfResultsSet results = processor.getResults() ;
    IDfQueryStatus status = processor.getQueryStatus() ;

    while (results.next())
    {
    System.out.println("results = " + results.getResult());
    }
    System.out.println("status = " + status);

Asynchronous search:
    // Caller implements IDfQueryListener

    // Establish session and get general query manager
    IDfSearchService searchService = <IDfClient>.newSearchService(<IDfSessionManager>);
    IDfQueryManager queryManager = searchService.newQueryMgr();

    // Create a new query builder for each query
    IDfQueryBuilder queryBuilder = queryManager.newQueryBuilder();
    IDfQueryProcessor processor = searchService.newQueryProcessor(queryBuilder, true);

    // Register as listener before starting the search
    processor.addListener(this);

    // Fire the search
    processor.search();

    // Go do some actual work while waiting for notifications:
    // - onQueryCompleted
    // - onStatusChange
    // - onResultChange

    ...

Result manipulation:

Some utility methods are provided to manipulate the result set in the class IDfResultsManipulator. Sort by on a specific attribute or using a custom comparator is possible.
Working with individual results and getting access to content is managed by IDfResultObjectManager


External sources attribute mapping:

External sources can be searched using the Federated Search Service option (FS2). These sources are integrated using FS2 Adapter technology. Each source may expose attributes different from regular Documentum type attributes. To provide a consistent view, external sources attributes are mapped into Documentum types attributes. By default, each results from an external source is considered of type "dm_document". This default type can be configured in each Adapter definition.
However, the attributes from external sources that don't match the expected Documentum type are still returned in the results.
The following mapping is performed:

Optional properties can also be sent in the query to FS2 Adapters using DfApplicationContext.


To access Java, Visual Basic and C++ DFC sample code, please visit the Documentum Developer Program.
Skip navigation links
DFC 23.4

Copyright 1994-2023 OpenText Corporation. All rights reserved.