-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Search- sort on date
PostPosted: Thu Nov 03, 2011 10:37 am 
Newbie

Joined: Tue Jul 26, 2011 6:46 pm
Posts: 11
In hibernate search, I want to sort the results on the java.util.Date. I have two questions regarding it.

1. I have added @Field annotation to the date field. Do I need to add @DateBridge also to it if all I want to do is sort and and not fire a range query.

2. What should be the SortFeild type when I am creating a Sort object. Should it be SortField.INT or SortField.STRING or something else?

Thanks :)


Top
 Profile  
 
 Post subject: Re: Search- sort on date
PostPosted: Thu Nov 03, 2011 12:02 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
1) @DateBridge is needed so you can define which precision you need

2) SortField.STRING

you can easily test these ;)

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Search- sort on date
PostPosted: Thu Nov 03, 2011 12:20 pm 
Newbie

Joined: Tue Jul 26, 2011 6:46 pm
Posts: 11
Thanks :)

And yeah, this I can surely test :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.