Hi,
I'm having problems trying to order the results obtained by Search WS. At the moment, a certain piece of code of our application performs a search over Livelink through Search WS, obtaining correctly a number of results, without any order indication. I want to change this behaviour, trying to obtain the same results ordered by the name of the element (OTName), but I cannot figure out how to do it.
Basic search is:
SingleSearchRequest request = new SingleSearchRequest();
request.setQueryLanguage(wsLivelinkBean.getSearchLenguaje());
request.setDataCollectionSpec(wsLivelinkBean.getSearchDataCollection());
request.setFirstResultToRetrieve(numPrimerResult);
request.setNumResultsToRetrieve(numResultsAObtener);
request.setResultSetSpec(query.toString());
SingleSearchResponse response = servicioBusquedas.search(request, "");
Which works correctly. Adding the order this way:
request.setResultOrderSpec("rankby=OTName&rankdirection=ascending");
server responds there is an error in evaluating the query. Changing it this way:
request.setResultOrderSpec("rankby=\"OTName\"&rankdirection=ascending");
no error occurs, but the results are not ordered. Changing it this way:
request.setResultOrderSpec("sortbyregion=OTName");
then the error is "Error loading SingleSearchResponse.Results".
Which is the correct way to call it?
Kind regards.