Quantcast

Best way to do time sort

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Best way to do time sort

aravinth thangasami
I am indexing a time field. I need to get the latest results and my index
contains millions of documents with frequent updates almost 90% of the
index updates.


option 1:

To index the time as string

option 2:

To index the time field as Number

option 3:

To index the time field as DocValue


Which option will be the best approach ??


Thanks
Aravinth
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Best way to do time sort

Michael McCandless-2
Doc values (your option 3) is the right way to sort by time.  Index it with
whatever precision you need, e.g. msec since epoch as a long
NumericDocValuesField.

Mike McCandless

http://blog.mikemccandless.com

On Mon, Mar 13, 2017 at 9:53 AM, aravinth thangasami <
[hidden email]> wrote:

> I am indexing a time field. I need to get the latest results and my index
> contains millions of documents with frequent updates almost 90% of the
> index updates.
>
>
> option 1:
>
> To index the time as string
>
> option 2:
>
> To index the time field as Number
>
> option 3:
>
> To index the time field as DocValue
>
>
> Which option will be the best approach ??
>
>
> Thanks
> Aravinth
>
Loading...