Re: Indexing a Date/DateTime/Time field in Lucene 4

2017-04-08 Thread KARTHIK SHIVAKUMAR
I did use the Date into millisec and stored the long into index, this helped me to convert the searched index into any date format later on the o/p. On Wed, Apr 5, 2017 at 6:08 PM, Frederik Van Hoyweghen < frederik.vanhoyweg...@chapoo.com> wrote: > Hey everyone, > > I'm seeing some conflicting su

RE: Indexing a Date/DateTime/Time field in Lucene 4

2017-04-05 Thread Uwe Schindler
n Hoyweghen > [mailto:frederik.vanhoyweg...@chapoo.com] > Sent: Wednesday, April 5, 2017 3:17 PM > To: java-user@lucene.apache.org > Subject: Re: Indexing a Date/DateTime/Time field in Lucene 4 > > Let's say I want to search between 2 dates, search for a date that's > before/after a

Re: Indexing a Date/DateTime/Time field in Lucene 4

2017-04-05 Thread Frederik Van Hoyweghen
Let's say I want to search between 2 dates, search for a date that's before/after another, etc (the usual stuff ^^ ), is this all with either fieldtype? Thanks for your reply! Frederik On Wed, Apr 5, 2017 at 3:04 PM, Adrien Grand wrote: > Hi Frederik, > > Both options would work but LongField (

Re: Indexing a Date/DateTime/Time field in Lucene 4

2017-04-05 Thread Adrien Grand
Hi Frederik, Both options would work but LongField (or LongPoint on Lucene 6.0+) would indeed provide better performance for range queries. If you need to sort or aggregate date values, you might also want to add a NumericDocValuesField. Le mer. 5 avr. 2017 à 14:38, Frederik Van Hoyweghen < frede

Indexing a Date/DateTime/Time field in Lucene 4

2017-04-05 Thread Frederik Van Hoyweghen
Hey everyone, I'm seeing some conflicting suggestions concerning the type of field to use for indexing a Date/DateTime/Time value. Some suggest conversion using DateTools.timeToString() and using a StringField, while others suggest using the long value of getTime() and using a LongField (this is