We're Hiring!

SearchPrx.addOrderByAsc

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

SearchPrx.addOrderByAsc

Postby johnjhufnagle » Tue Sep 06, 2011 2:36 pm

Hi,
I'm trying to figure out how to use addOrderByAsc/Desc.
What is the single parameter 'path'?
If I am performing byFullText() search can I order by an indexed field of the document?
I have a date field that in yyyymmdd format and would like to use that for my result ordering.

Thanks
John
johnjhufnagle
 
Posts: 34
Joined: Tue Dec 15, 2009 8:50 pm

Re: SearchPrx.addOrderByAsc

Postby jmoore » Thu Sep 08, 2011 8:24 am

Hi John,

addOrderBy is passed to a Criteria search on the top level object. So if you are running "onlyBy('Image')", then the "this" of the path is image. Examples of order-bys which you can use are:
Code: Select all
~/git $ git grep addOrderBy
components/server/test/ome/server/itests/search/SearchTest.java:        search.addOrderByDesc("description");
components/server/test/ome/server/itests/search/SearchTest.java:        search.addOrderByDesc("id");
components/server/test/ome/server/itests/search/SearchTest.java:        search.addOrderByDesc("details.creationEvent.id");
components/server/test/ome/server/itests/search/SearchTest.java:        search.addOrderByDesc("details.creationEvent.time");


Hope that helps.
~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 0 guests