cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to Sort in Java Backed Webscript

nitinagarwal198
Champ in-the-making
Champ in-the-making
Hi,

I have done the following code for the sorting of nodes. but this is not working.

RepoSearchInitializer searchInitializer = new RepoSearchInitializer();
String qry ="TYPE:\"{com.infoaxon.fkm.repository}resource\"";
SearchParameters searchParameters = searchInitializer.invokeSearchParameter(qry);
searchParameters.addSort("{com.infoaxon.fkm.repository}resourceTitle",true);
ResultSet results = serviceRegistry.getSearchService().query(searchParameters);

Can anyone tell me what is the problem with this code and please tell me the right code.

Thanks,
Nitin
1 REPLY 1

kevinr
Star Contributor
Star Contributor
I think the addSort line should read:
searchParameters.addSort("@{com.infoaxon.fkm.repository}resourceTitle",true);
I assume that the model property is indexed (it probably will be unless you have explicitly disabled indexing for it).

FYI the JavaScript API is very nice to do this kind of thing in webscripts.

Kev