You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Digy (JIRA)" <ji...@apache.org> on 2010/03/18 18:50:27 UTC

[jira] Created: (LUCENENET-353) IndexReader.LastModified giving invalid date?

IndexReader.LastModified giving invalid date?
---------------------------------------------

                 Key: LUCENENET-353
                 URL: https://issues.apache.org/jira/browse/LUCENENET-353
             Project: Lucene.Net
          Issue Type: Bug
         Environment: Lucene.Net 2.9.x
            Reporter: Digy
            Priority: Minor


I am opening this issue on behalf of Paulo Ferreira.

"IndexReader.LastModified giving invalid date?"  thread in http://mail-archives.apache.org/mod_mbox/lucene-lucene-net-user/201003.mbox/browser

DIGY

{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.


[jira] Commented: (LUCENENET-353) IndexReader.LastModified giving invalid date?

Posted by "Paulo F Ferreira (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12847078#action_12847078 ] 

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 Lucene.net 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.

-Paulo


> IndexReader.LastModified giving invalid date?
> ---------------------------------------------
>
>                 Key: LUCENENET-353
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-353
>             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 http://mail-archives.apache.org/mod_mbox/lucene-lucene-net-user/201003.mbox/browser
> DIGY
> {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.


[jira] Updated: (LUCENENET-353) IndexReader.LastModified giving invalid date?

Posted by "Digy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-353?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy updated LUCENENET-353:
---------------------------

    Attachment: FSDirectory.patch

FSDirectory.FileModified returns now milliseconds since the epoch (00:00:00 GMT,
January 1, 1970)


> IndexReader.LastModified giving invalid date?
> ---------------------------------------------
>
>                 Key: LUCENENET-353
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-353
>             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 http://mail-archives.apache.org/mod_mbox/lucene-lucene-net-user/201003.mbox/browser
> DIGY
> {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.


[jira] Resolved: (LUCENENET-353) IndexReader.LastModified giving invalid date?

Posted by "Digy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-353?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy resolved LUCENENET-353.
----------------------------

    Resolution: Fixed

Thanks Paulo for reporting this.
I committed the patch.

DIGY

> IndexReader.LastModified giving invalid date?
> ---------------------------------------------
>
>                 Key: LUCENENET-353
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-353
>             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 http://mail-archives.apache.org/mod_mbox/lucene-lucene-net-user/201003.mbox/browser
> DIGY
> {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.