You'll have to search the archives for a more complete explanation, I'm going from memory here.. (or perhaps it's on the Wiki, I don't remember).
The notion is to break apart your timestamp (if you really, really need the precision) into several fields rather than one. I.e. index the YYYYMMDD as one field, then perhaps HHSS a second field and, perhaps, milliseconds as a third field. This *greatly* reduces the number of unique terms and should improve searching on ranges, not to mention sorting. You'll have to manipulate the timestamp part of the query. There are variations on the scheme, you could have 6 fields for instance, YYYY, MM, DD, HH, SS, MS for instance. Or.... But the very best solution is to do as Erik (no relation) H. suggests, just reindex with, say, day granularity if that's fine enough. Best Erick On Wed, Jan 7, 2009 at 6:03 AM, Erik Hatcher <e...@ehatchersolutions.com>wrote: > > On Jan 6, 2009, at 9:17 PM, Jim Adams wrote: > >> Can someone explain what this means to me? >> > > The below <field> definition sets the timestamp field without time > granularity, just day. It's the difference between, say you've indexed a > document for every millisecond in a day (what is that, 86.4M?), and a single > term for the single date. > > I'm having a similar performance issue - it's an index with only 1 million >> records or so, but when trying to search on a date range it takes 30 >> seconds! Yes, this date is one with hours, minutes, seconds in them -- do >> I >> need to create an additional field without the time component and reindex >> all my documents so I can get decent search performance? Or can I tell >> Solr >> "Please ignore the time and do something in a reasonable timeframe" (GRIN) >> > > Do you care about milliseconds, seconds, minutes, or hours in terms of > searching? If not, it's a very good idea to reduce the granularity and thus > the number of unique terms. > > Erik > > > > >> >> Thanks. >> >> On Fri, Oct 31, 2008 at 10:28 PM, Michael Lackhoff <mich...@lackhoff.de >> >wrote: >> >> On 01.11.2008 06:10 Erik Hatcher wrote: >>> >>> Yeah, this should work fine: >>>> >>>> <field name="timestamp" type="date" indexed="true" stored="true" >>>> default="NOW/DAY" multiValued="false"/> >>>> >>> >>> Wow, that was fast, thanks! >>> >>> -Michael >>> >>> >