cancel
Showing results for 
Search instead for 
Did you mean: 

Sort using SearchParameters

kmehta311
Champ in-the-making
Champ in-the-making
Hi all,

We are having web form for creating Divisions. In my webscript I iterate our all the webforms using following query:

SearchParameters sp = new SearchParameters();         
sp.addStore(getStoreReference());         
sp.setLanguage(SearchService.LANGUAGE_LUCENE);

StringBuffer strBfrQuery = new StringBuffer();
strBfrQuery.append("@\\{http\\://www.alfresco.org/model/wcmappmodel/1.0\\}parentformname:\'Division\"");
sp.setQuery(strBfrQuery.toString());

String strQname = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "title").toString();
sp.addSort(strQname, true);

I am expecting the resultset to return the sorted results on Title. But its giving random results that are not sorted.

I also tried sorting based on division name which is one of the property we index out of the Webform
If I add following line it gives null pointer exception
sp.addSort("@"+"{http://www.nbc.com/model/wcm/mediavillage/1.0}divisonName',true);

And if I add following line

sp.addSort("{http://www.nbc.com/model/wcm/mediavillage/1.0}divisonName',true); It gives me same defult order. Means not what I m expecting the sort on divisionName.

Neither of this is working fine.

Can anyone help me out in this to understand what m i doing wrong. M i missing anything…

Thanking you in andvance.
1 REPLY 1

kmehta311
Champ in-the-making
Champ in-the-making
Hi,

If any help on this would really appreciate.
Alfresco team pls help!

Thanking you in advance.

Kalpesh