You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Scott Ganyo <sc...@eTapestry.com> on 2002/08/07 16:27:24 UTC

IndexReader.lastModified() not correct

The current implementation of IndexReader.lastModified() does not return the
results I am expecting.  Here is the implementation:

  /** 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");
  }

The problem is that the "segments" file is apparently not updated when just
doing a delete from an index.  This is causing me problems because I am
attempting to rely on on the lastModified() command for IndexSearcher
caching.  The only solution that I have thought of so far (without changing
other parts of Lucene) is to make the lastModified() command look at all the
files in the last segment for the last modified date.

Thoughts?

Thanks,
Scott