You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Ryan McKinley <ry...@gmail.com> on 2012/02/07 21:29:48 UTC
IndexReader.lastModified(reader.directory()) replacement?
I'm upgrading some stuff to lucene trunk.... is there any way to get
the last modified date from an AtomicReader? or an
AtomicReaderContext?
thanks
ryan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
RE: IndexReader.lastModified(reader.directory()) replacement?
Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,
An index directory is always a CompositeReader, so single segment never
knows a modification date, so it's not part of AtomicReader. The only part
that might know anything about index commits, directories,... is
DirectoryReader (see my blog post).
But all that's not the cause for your problem it has nothing to do with my
refactoring, lastModified is broken and was removed by Mike McCandless:
https://issues.apache.org/jira/browse/LUCENE-3672
Uwe
-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
> -----Original Message-----
> From: Ryan McKinley [mailto:ryantxu@gmail.com]
> Sent: Tuesday, February 07, 2012 9:30 PM
> To: dev@lucene.apache.org
> Subject: IndexReader.lastModified(reader.directory()) replacement?
>
> I'm upgrading some stuff to lucene trunk.... is there any way to get the
last
> modified date from an AtomicReader? or an AtomicReaderContext?
>
> thanks
> ryan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional
> commands, e-mail: dev-help@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
RE: IndexReader.lastModified(reader.directory()) replacement?
Posted by Uwe Schindler <uw...@thetaphi.de>.
Then thats what you need!
-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
> -----Original Message-----
> From: Ryan McKinley [mailto:ryantxu@gmail.com]
> Sent: Tuesday, February 07, 2012 9:57 PM
> To: dev@lucene.apache.org
> Subject: Re: IndexReader.lastModified(reader.directory()) replacement?
>
> On Tue, Feb 7, 2012 at 12:38 PM, Michael McCandless
> <lu...@mikemccandless.com> wrote:
> > You need to store this in the IndexCommit.
> >
> > Ie, when you commit, pass the Map<String,String> userData that holds
> > the timestamp (and anything else you want to store...).
> >
> > Or, use DR.getVersion or DR.getIndexCommit().getGeneration() as
> > similar replacements.
> >
> > Can you describe how you were using IR.lastModified...?
> >
>
> DR.getVersion() should work -- I just need a way to know if anythign has
> changed.
>
> thanks
> ryan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional
> commands, e-mail: dev-help@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: IndexReader.lastModified(reader.directory()) replacement?
Posted by Ryan McKinley <ry...@gmail.com>.
On Tue, Feb 7, 2012 at 12:38 PM, Michael McCandless
<lu...@mikemccandless.com> wrote:
> You need to store this in the IndexCommit.
>
> Ie, when you commit, pass the Map<String,String> userData that holds
> the timestamp (and anything else you want to store...).
>
> Or, use DR.getVersion or DR.getIndexCommit().getGeneration() as
> similar replacements.
>
> Can you describe how you were using IR.lastModified...?
>
DR.getVersion() should work -- I just need a way to know if anythign
has changed.
thanks
ryan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: IndexReader.lastModified(reader.directory()) replacement?
Posted by Michael McCandless <lu...@mikemccandless.com>.
You need to store this in the IndexCommit.
Ie, when you commit, pass the Map<String,String> userData that holds
the timestamp (and anything else you want to store...).
Or, use DR.getVersion or DR.getIndexCommit().getGeneration() as
similar replacements.
Can you describe how you were using IR.lastModified...?
Mike McCandless
http://blog.mikemccandless.com
On Tue, Feb 7, 2012 at 3:29 PM, Ryan McKinley <ry...@gmail.com> wrote:
> I'm upgrading some stuff to lucene trunk.... is there any way to get
> the last modified date from an AtomicReader? or an
> AtomicReaderContext?
>
> thanks
> ryan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org