lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Blinn" <>
Subject Overflow exception when sorting by a date field
Date Fri, 10 Nov 2006 15:10:27 GMT
I'm trying to sort a query's results by a field that contains a date value,
but I'm getting OverflowExceptions. Here's an example stack trace

System.OverflowException : Value was either too large or too small for an
    at System.Number.ParseInt32(String s, NumberStyles style,
NumberFormatInfo info)
    at System.Int32.Parse(String s)
    at Lucene.Net.Search.FieldCacheImpl.AnonymousClassIntParser.ParseInt(String
    at Lucene.Net.Search.FieldCacheImpl.GetInts(IndexReader reader, String
field, IntParser parser)
    at Lucene.Net.Search.FieldCacheImpl.GetInts(IndexReader reader, String
    at Lucene.Net.Search.FieldCacheImpl.GetAuto (IndexReader reader, String
    at Lucene.Net.Search.FieldSortedHitQueue.ComparatorAuto(IndexReader
reader, String fieldname)
    at Lucene.Net.Search.FieldSortedHitQueue.GetCachedComparator(IndexReader
reader, String fieldname, Int32 type, CultureInfo locale,
SortComparatorSource factory)
    at Lucene.Net.Search.FieldSortedHitQueue..ctor(IndexReader reader,
SortField[] fields, Int32 size)
    at Lucene.Net.Search.IndexSearcher.Search(Weight weight, Filter filter,
Int32 nDocs, Sort sort)
    at Lucene.Net.Search.Hits.GetMoreDocs (Int32 min)
    at Lucene.Net.Search.Hits..ctor(Searcher s, Query q, Filter f, Sort o)
    at Lucene.Net.Search.Searcher.Search(Query query, Sort sort)

The date field is stored as a string and is constructed using:
DateTools.DateToString(time, DateTools.Resolution.SECOND);, where time is a
System.DateTime. Am I doing something wrong, or is a workaround for this
aside from sorting myself?


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