Posted Feb 25 by Peng Qiu.
Updated Feb 26.

As the first post of the series, you will learn what is AQL and how to execute search with AQL.

Last activity Feb 26 by Peng Qiu.
68 views. 0 comments.

Overview

Since Documentum REST Services 7.3, users can execute full-text search with Abstract Query Language (AQL), which can provide more sophisticated search criteria, comparing with Search Service with Simple Search Language. Besides, search persistence and search template are supported as well.

This tutorial series introduces a user scenario and shows how to fulfill the cases step by step. When finishing the tutorial, you should know

  • what search related services can do
  • how to consume the search services

As the first post of the series, you will learn what is AQL and how to execute search with AQL.

Part 1. Advanced Searches in Documentum REST Services (1): AQL
Part 2. Advanced Searches in Documentum REST Services (2): Facets
Part 3. Advanced Searches in Documentum REST Services (3): Saved Searches
Part 4. Advanced Searches in Documentum REST Services (4): Search Templates

Preliminary

To consume full-text search services in Documentum, the xPlore server including the index agent, should be deployed and configured for Content Server. Details can be found in the product documentation of xPlore.

To run the full-text search services, we need to prepare some documents in the repository. You can choose some PDF files by yourself. This is the screenshot of Documentum Administrator after documents are imported.

enter image description here

Please also set the attribute keywords on these 5 documents. Here is a table for the details.

enter image description here

enter image description here

Discover Search Service

The advanced search service's link relation and URI pattern is the same as the simple search service. In the representation of repository resource, there is a link relation http://identifiers.emc.com/linkrel/search pointing to the search service.

{
    "id": 2,
    "name": "REPO1",
    ...
    "links": [
        ...
        {
            "rel": "http://identifiers.emc.com/linkrel/search",
            "hreftemplate": "http://localhost:8080/dctm-rest/repositories/REPO1/search{?collections,facet,include-total,inline,items-per-page,locations,object-type,page,q,sort,timezone,view}"
        }
    ]
}

Abstract Query Language

In Tutorial: Full-text Search with Documentum REST Services, the search criteria is quite simple - a keyword tutorial. What if users want to specify the document size, owner and name? AQL comes for such requirements in release 7.3.

The full specification of AQL won't be covered in this article; instead, we use samples to demonstrate how to construct AQL. Here is the first sample of an AQL request in XML.

<search xmlns="http://identifiers.emc.com/vocab/documentum" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <types>
        <type>dm_document</type>
    </types>
    <expression-set operator="AND">
        <expressions>
            <fulltext>REST</fulltext>
            <property name="object_name" operator="BEGINS_WITH">Doc</property>
            <property-list name="owner_name" operator="IN">
                <values>
                    <value>Administrator</value>
                </values>
            </property-list>
            <property-range name="r_full_content_size" operator="BETWEEN">
                <from>130000</from>
                <to>900000</to>
            </property-range>
        </expressions>
    </expression-set>
</search>

The above AQL sample describes these search criteria:

  1. the object type must be dm_document or its sub types
  2. A full-text expression defines the keyword REST
  3. A property expression defines the object name starting with Doc
  4. A property-list expression defines the owner name is in the name list of Administrator
  5. A property-range expression defines the document size is in the range 130000 - 900000 bytes
  6. Conditions 2~5 must be met together since the joiner is AND

Execute Advanced Search

The snippet below makes a POST request to search service and AQL statements above is the request body, which is not shown here.

POST http://localhost:8080/dctm-rest/repositories/REPO1/search?include-total=true
Content-Type: application/xml
Accept: application/xml

// the above AQL sample

It will return the search results as a feed. For this request, there is only 1 result.

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    ...
    <dm:total xmlns:dm="http://identifiers.emc.com/vocab/documentum">1</dm:total>
    ...
    <entry>
        <id>0900000280001430</id>
        <title>Doc-2.pdf</title>
        <author>
            <name>Administrator</name>
        </author>
        <summary>Manage Document Contents in Documentum REST Services This doc... delete primary contents and renditions in Documentum REST Services.... GET http://localhost:8080/dctm-rest/repositories/repo/folders...:8080/dctm-rest/repositories/repo/folders/0b0000018000416b</summary>
        <updated>2018-11-09T12:51:55.000+00:00</updated>
        <link rel="edit" href="http://localhost:8080/dctm-rest/repositories/REPO1/objects/0900000280001430"></link>
        <content type="application/xml" src="http://localhost:8080/dctm-rest/repositories/REPO1/objects/0900000280001430"></content>
        <relevance:score xmlns:relevance="http://a9.com/-/opensearch/extensions/relevance/1.0/">1.0</relevance:score>
        <dm:terms xmlns:dm="http://identifiers.emc.com/vocab/documentum">
            <dm:term>rest</dm:term>
            <dm:term>REST</dm:term>
            <dm:term>doc</dm:term>
        </dm:terms>
    </entry>
</feed>

If you decrease the from value in the document size range expression in AQL, more than one search results will be returned.

As a sample, this AQL request is quite straightforward. In fact, AQL is powerful and flexible, with which users can define complex search criteria to meet complicated requirements

Conclusion

Starting from Documentum REST 7.2, full-text search is included, with basic functionality via Simple Search Language. The release 7.3 makes a big step forward with AQL. With this post, you get to know:

  • AQL can do much more than Simple Search Language
  • AQL has many kinds of expressions for users to work out complex search criteria
  • Use HTTP method POST to execute the AQL request

Next: Part 2. Advanced Searches in Documentum REST Services (2): Facets


Table of Contents

Your comment

To leave a comment, please sign in.