lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject RE: IndexReader.lastModified();
Date Mon, 05 May 2003 20:12:20 GMT
Oh, I see what you mean.  You are talking about the delta between the
original time stamp, and the time stamp that you expect after you add a
document.  I thought you were saying that it takes the F/S at least a
second to update the time stamp, after the file has been modified.

In that case, this is a file system issue that Lucene can't do much
about.

Otis

--- Rob Outar <routar@ideorlando.org> wrote:
> We looked it up on Goggle, ext2 file system does not update the last
> mod
> date if the change to the file is under 1 second.  Also I don't
> remember
> cause my brain hurts, when Linux returned the time it did not include
> ms,
> but on Windows it did, all my queries on Windows worked because of
> this.
> 
> A sleep does not work, it is the modification time, of the file, not
> how
> long the test takes.
> 
> Thanks,
> 
> Rob
> 
> 
> -----Original Message-----
> From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com]
> Sent: Monday, May 05, 2003 3:53 PM
> To: Lucene Users List
> Subject: RE: IndexReader.lastModified();
> 
> 
> I wouldn't trust that < 1 second statement :)
> Just put a sleep in your unit test and see.
> 
> Otis
> 
> --- Rob Outar <routar@ideorlando.org> wrote:
> > My Linux admin told me that if a change to a file occurs in less
> than
> > one
> > second Linux does not update the last mod date.  Has anyone else
> > experienced
> > this? or is this even possible?  I have spent hours and hours
> > debugging my
> > code and the date thing is the only thing I can see as causing my
> > queries to
> > fail.
> >
> >
> > Thanks,
> >
> > Rob
> >
> >
> > -----Original Message-----
> > From: Rob Outar [mailto:routar@ideorlando.org]
> > Sent: Monday, May 05, 2003 2:42 PM
> > To: Lucene Users List
> > Subject: RE: IndexReader.lastModified();
> >
> >
> >   /** Returns the time the index in the named directory was last
> > modified.
> > */
> >   public static long lastModified(File directory) throws
> IOException
> > {
> >     return FSDirectory.fileModified(directory, "segments");
> >   }
> >
> >   /** Returns the time the named file was last modified. */
> >   public final long fileModified(String name) throws IOException {
> >     File file = new File(directory, name);
> >     return file.lastModified();
> >   }
> >
> >   /** Returns the time the named file was last modified. */
> >   public static final long fileModified(File directory, String
> name)
> >        throws IOException {
> >     File file = new File(directory, name);
> >     return file.lastModified();
> >   }
> >
> > Could this be a problem in Linux where the files last mod date are
> > not being
> > updated fast enough?
> >
> > Thanks,
> >
> > Rob Outar
> > OneSAF A&I -- SAIC
> > Software\Data Engineer
> > 321-235-7660
> > outarr@saic.com <mailto:outarr@saic.com>
> >
> >
> > -----Original Message-----
> > From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com]
> > Sent: Monday, May 05, 2003 2:37 PM
> > To: Lucene Users List
> > Subject: Re: IndexReader.lastModified();
> >
> >
> > I don't remember any more, but maybe lastModified() returns a new
> > value
> > only after the IndexWriter is close()d.  You may be able to tell
> from
> > looking at the source.... or you should just try that and see.
> >
> > Otis
> >
> >
> > --- Rob Outar <routar@ideorlando.org> wrote:
> > > Hi all,
> > >
> > > 	I am experiencing a weird problem in Linux.  When I initially
> > create
> > > the
> > > index I store the date with the IndexReader.lastModified() call. 
> I
> > > then
> > > have a Junit test that adds a document to the index, I then have
> a
> > > method
> > > that checks if the index has changed and if it has I create a new
> > > IndexSearcher.  The problem is the date the index was created and
> > the
> > > most
> > > recent call to IndexReader.lastModified()(after adding a
> document)
> > > are
> > > returning the same value so when I query on the new document I
> just
> > > added it
> > > is failing because according to the dates, the index has not
> > changed
> > > so I
> > > did not create a new IndexSearcher!!!
> > >
> > > 	Has anyone experience this before?  If so, is there a known fix?
> > >
> > > Thanks,
> > >
> > > Rob
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> lucene-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > lucene-user-help@jakarta.apache.org
> > >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Search - Faster. Easier. Bingo.
> > http://search.yahoo.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> lucene-user-help@jakarta.apache.org
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> lucene-user-help@jakarta.apache.org
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> lucene-user-help@jakarta.apache.org
> >
> 
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message