I am developing an application using Content DB API's. I am using SearchManager API to perform a search in my application. I have to develop a search expression using CDB API's that excludes the Trash Results in my Search results.
I am new to CDB. Please help me in solving this issue.
I am trying to build a search expression that should return the files last modified since specified date and exclude the files from Trash.
//Expression to retrieve files since the specified date
firstexpr = new SearchExpression();
//Expression to exclude files from Trash.
secexpr = new SearchExpression();
//Expression to combine above two expressions.
thirdexpr = new SearchExpression();
when i run my application i am getting the Error saying Invalid Search expression.
the javadoc for SearchExpression does not list Attributes.IS_IN_TRASH as an allowed attribute to search for, hence the error.
There is no specific search option to prevent items being returned from trash.
Possible workarounds are to restrict search to a particular set of folders within a Library, or perform post processing (most likely option).
Depending on how many results the search is likely to return, you could either request up front (as part of the AttributeRequest in SearchManager.search() )the Attributes.IS_IN_TRASH option for the full set of search results (if result set likely to be small), or, perform this on demand for a page of results at a time (when dealing with a potentially unbounded result set which is unlikely to be viewed in total).