lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <>
Subject Re: Best way to do date sort
Date Tue, 13 Jan 2009 13:47:46 GMT
This question, along with many possible answers has been
discussed many times, so there's a wealth of information
in the searchable archive.

The short form is "it depends". Do you want to sort? In
that case storing a single field will cost you when sorting.
Store the coarsest granularity you can. Consider breaking
up the date field (i.e. one field containintg YYYYMMDD,
perhaps one field containing HHMM or even one field
with HH and one with MM).

This kind of strategy will save you far more space than worrying
about strings vs number. And will sort faster. etc.


On Tue, Jan 13, 2009 at 4:07 AM, Ganesh <> wrote:

> I am indexing and storing date time with minute resolution. I need to do
> date range query and also do sorting on this field. I am having almost 30
> million records spread across 20 database.
> option1:
> To index the date time as string
> option2:
> To index date, hour and minute separately as number.
> Which option will consume lesser memory?
> Whether date range query will also load all data using FieldImpl?
> Regards
> Ganesh
> Send instant messages to your online friends
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message