Question & Answer
Question
Following the documentation specified at: https://www.ibm.com/support/knowledgecenter/SSEUEX_3.0.1/com.ibm.develo… You may encounter an error "API_PROPERTY_NOT_IN_CACHE: The ClassDescription property was not found in the properties collection."
Cause
The ecm.model.SearchQuery API requires additional parameters, without which you will get errors while attempting to use the API. The required parameters are underlined in the Answer section.
Answer
1) You must provide the repository in the parameters.
2) You must include ClassDescription in the select statement, otherwise you get the "API_PROPERTY_NOT_IN_CACHE: The ClassDescription property was not found in the properties collection." exception.
3) You must include the resultsDisplay parameter, otherwise the search will return the properties configured for repository's search results and otherwise ignore the properties in the select statement.
Example code below:
queryParams.query = "SELECT ClassDescription, DocumentTitle, ContentSize, LastModifier, ID, Creator FROM Document ORDER BY LastModifier";
queryParams.retrieveAllVersions = false;
queryParams.retrieveLatestVersion = true;
queryParams.repository = Desktop.repositories[0];
queryParams.resultsDisplay = {
"sortBy": "LastModifier","sortAsc": true,
"columns": ["DocumentTitle", "ContentSize","LastModifier", Creator"],
"honorNameProperty": true};
var searchQuery = new SearchQuery(queryParams);}
searchQuery.search(function(response){
console.debug("::response", response);
console.debug("::response", response.getColumns());
console.debug("::response.items[0].name", response.items[0].name);
}
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
swg22007667