lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulo F Ferreira (JIRA)" <>
Subject [jira] Commented: (LUCENENET-353) IndexReader.LastModified giving invalid date?
Date Thu, 18 Mar 2010 19:28:27 GMT


Paulo F Ferreira commented on LUCENENET-353:

(First, thanks for submitting this for me, Digy!)

Oh, it's supposed to be ms since the 1970 epoch and not simply Ticks?

The 1.9.1 & 2.0 branches both used 'file.LastWriteTime.Ticks', which of course
may have been incorrect.

The MSDN docs say that the DateTime ticks "represents the number of 100-nanosecond intervals
that have elapsed since 12:00:00 midnight, January 1, 0001"

I don't know what Java uses, nor do I know what the method is *supposed* to return.


> IndexReader.LastModified giving invalid date?
> ---------------------------------------------
>                 Key: LUCENENET-353
>                 URL:
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: Lucene.Net 2.9.x
>            Reporter: Digy
>            Priority: Minor
>         Attachments: FSDirectory.patch
> I am opening this issue on behalf of Paulo Ferreira.
> "IndexReader.LastModified giving invalid date?"  thread in
> {quote}
> Hi there,
> I am moving an app over from using Lucene 2.0, to Lucene 2.9.1, and I've run
> into some issues with IndexReader.LastModified.
> An index which I modify with Lucene 2.0 is correctly giving me the following
> 'long' and formatted DateTime from IndexReader.LastModified:
>  634042806373153466
>  3/15/2010 8:10:37 PM
> When I use Lucene 2.9.1, I get the following:
>  315
>  01/01/0001 12:00:00 AM
> For what it's worth, in both cases the IndexReader.GetCurrentVersion method
> returns the same value: 634039174881899260
> Reading the contents of the index works perfectly fine using both versions
> of Lucene; I can dump all the documents/fields, and perform searches, and
> everything else looks fine.
> Also, creating a _brand new_ index using Lucene 2.9.1 ALSO results
> IndexReader.LastModified returning an invalid date, so I don't think my
> problem is necessarily related to reading an old index with a newer version
> of Lucene 2.9.1.  In this particular test, the LastModified 'long' value was
> 467 and the GetCurrentVersion() result was 63404283599391.
> Anyone have any thoughts as to what I am doing wrong?  Is this expected
> behaviour with the latest version?
> Note that I am not trying to use this method to determine if the current
> IndexReader is up to date, but rather using it for other purposes.
> I've also tried using both the 'string' and 'SimpleFSDirectory' versions of
> the LastModified method with the same result.
> Thanks,
> -Paulo
> {quote}

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message