cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco CMIS search

vbr
Champ in-the-making
Champ in-the-making
Hi,

I'm using in Java the SearchService to search custom folder on the repository using the CMIS Query language and transactional metadata to Query directly on the database.

To archieve this, I'm using the SearchParam like this :


String cmisQuery = "SELECT * FROM " + WvnEdmsModel.QNAME_TYPE_DOSSIER.toPrefixString() + " WHERE " + WvnEdmsModel.QNAME_PROP_E_SPACE_ID.toPrefixString() + " = '" + eSpaceId + "'";

SearchParameters searchParam = new SearchParameters();
searchParam.setLanguage(SearchService.LANGUAGE_CMIS_ALFRESCO);
searchParam.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
searchParam.setQuery(cmisQuery);
searchParam.setQueryConsistency(QueryConsistency.TRANSACTIONAL);
searchParam.addSort("@wvnEdms:currentStatus", true);


However, I don't know why but the results are not ordered…

I tried to add 'order by wvnEdms:currentStatus' to my Query. It works only for String, Integer and DateTime (see here http://docs.alfresco.com/4.2/concepts/intrans-metadata-query.html)


Have you an idea what I'm making wrong with searchParam.addSort ?


Thank you
1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator

If you go look at the type definition in something like CMIS Workbench, does that property show as being orderable? It might not be. For example, if you defined it in your content model as being tokenized (the default) it won't be orderable.