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).
|
|
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.
|
Field Detail
pageSize
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
resultsDisplay
(see ecm.model._SearchMixin#resultsDisplay).
retrieveAllVersions
retrieveLatestVersion
Method Detail
search(callback, sortProperty, descending, teamspace, errorCallback)
- 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