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 19:52:31 GMT
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


Mime
View raw message