You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by io...@novartis.com on 2005/04/06 13:02:35 UTC

Re: Sorting date stored in milliseconds time

I'm  forced to keep date up to milisec. The reason is simple: I get at
least a couple of new messages per sec, if all of them are stamped with the
same time, the retrieval order id undefined, i.e.  once I get it, let's
say, as the last reference on the first page, other time - as the first one
on the second page. In case You do not keep the cache and always performs
the same query even to get the second page it's getting even worse, i.e.
displaying the messgaes 41-80, may bring the message 41, which You already
displayed on your first page as message 40.



                                                                                                                               
                      Morus Walter                                                                                             
                      <morus.walter@tan        To:       "Lucene Users List" <lu...@jakarta.apache.org>, Ben             
                      to.de>                    <ne...@gmail.com>                                                         
                                               cc:       (bcc: Iouli Golovatyi/X/GP/Novartis)                                  
                      28.02.2005 08:47         Subject:  Re: Sorting date stored in milliseconds time                          
                      Please respond to                                                                                        
                      "Lucene Users            Category:       |-------------------------|                                     
                      List"                                    | ( ) Action needed       |                                     
                                                               | ( ) Decision needed     |                                     
                                                               | ( ) General Information |                                     
                                                               |-------------------------|                                     
                                                                                                                               
                                                                                                                               




Ben writes:
>
> I store my date in milliseconds, how can I do a sort on it? SortField
> has INT, FLOAT and STRING. Do I need to create a new sort class, to
> sort the long value?
>
Why do you need that precicion?
Remember: there's a price to pay. The memory required for sorting and
the time to set up the sort cache depends on the number of different terms,
dates in your case.
I can hardly think of an application where seconds are relevant, what do
you need milliseconds for?

Morus

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org







______________________________________________________________________
The Novartis email address format has changed to 
firstname.lastname@novartis.com.  Please update your address book 
accordingly.
______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Sorting date stored in milliseconds time

Posted by Scott Farquhar <sc...@atlassian.com>.
On Wed, Apr 06, 2005 at 01:02:35PM +0200, iouli.golovatyi@novartis.com wrote:
> I'm  forced to keep date up to milisec. The reason is simple: I get at
> least a couple of new messages per sec, if all of them are stamped with the
> same time, the retrieval order id undefined, i.e.  once I get it, let's
> say, as the last reference on the first page, other time - as the first one
> on the second page. In case You do not keep the cache and always performs
> the same query even to get the second page it's getting even worse, i.e.
> displaying the messgaes 41-80, may bring the message 41, which You already
> displayed on your first page as message 40.

Why can't you have a secondary sort on message id?  Then you sort by time
and message id will always result in consistent ordering.

Cheers,
Scott 

-- 
ATLASSIAN - http://www.atlassian.com
Expert J2EE Software, Services and Support
-------------------------------------------------------------
JIRA Docs: http://www.atlassian.com/software/jira/docs/latest

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org