Class ecm.model.SearchQuery


Extends ecm.model._Item.
Provides search functionality via a query string that conforms to the query language specifications of the underlying repository. When searching for FileNet P8 documents, the query must select the ClassDescription, Creator, Reservation, and ReservationType properties.

Usage (FileNet P8 query shown):

var searchQuery = new SearchQuery({
"repository": repository,
"query": "SELECT ClassDescription, ID, DocumentTitle, ContentSize, LastModifier, Creator, Reservation, ReservationType FROM Document ORDER BY LastModifier",
"resultsDisplay": {
"columns": [ "DocumentTitle", "ContentSize", "LastModifier" ],
"sortBy": "LastModifier",
"sortAsc": true,
"honorNameProperty": true }
});
searchQuery.search(function(response){
console.log("response", response);
});


Defined in: <ecm\model\SearchQuery.js>.

Constructor Summary

Constructor Attributes Constructor Name and Description
 
Constructs a search query.

Field Summary

Field Attributes Field Name and Description
 
The number of items to display per page in the search results (FileNet P8 only).
 
query 
A query string that conforms to the query language specifications of the underlying repository.
 
Specifies whether to retrieve the latest and non-latest versions of the items (CMIS only).
 
Specifies whether to retrieve the latest versions of the items via CM retrieval options, which is more efficient than the query alternative, i.e.

Method Summary

Method Attributes Method Name and Description
 
search(callback, sortProperty, descending, teamspace, errorCallback)
Runs the search.

Constructor Detail

ecm.model.SearchQuery()

Constructs a search query.
Since:
2.0.3

Field Detail

pageSize

The number of items to display per page in the search results (FileNet P8 only). If the specified value is less than 0, then 200 items per page are displayed by default. If the specified value is 0, then the maximum number of items retrieved is limited only by the query or the repository, and all items found are displayed on one page.

Important: If you display the search results in a content list, small page sizes (typically less than 50) are not recommended because additional requests might be sent to fill the content list. For example, if the content list displays 10 rows, and you set the page size to 6, the first 6 items returned by the search are displayed, but to fill the content list, an additional query attempts to retrieve 4 more items.
Since:
2.0.3.3

query

A query string that conforms to the query language specifications of the underlying repository. When searching in a FileNet P8 repository, the query's SELECT clause must at least include the ClassDescription, ID, and any other properties specified in the resultsDisplay (see ecm.model._SearchMixin#resultsDisplay).

retrieveAllVersions

Specifies whether to retrieve the latest and non-latest versions of the items (CMIS only).

retrieveLatestVersion

Specifies whether to retrieve the latest versions of the items via CM retrieval options, which is more efficient than the query alternative, i.e., "@VERSIONID = latest-version(.)" (CM only).

Method Detail

search(callback, sortProperty, descending, teamspace, errorCallback)

Runs the search.
Parameters:
callback
A function called with a {@ecm.model.ResultSet} object when the search has completed running
sortProperty
The ID of the attribute to sort by (mainly used by content lists to resort the results)
descending
Specifies whether to sort the results in descending order (mainly used by content lists to resort the results)
teamspace
Not supported
errorCallback
A function called with the response object when the search fails