lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Debajyoti Bera <dbera....@gmail.com>
Subject IndexReader.IndexExists bug
Date Sat, 23 Feb 2008 04:12:37 GMT
Hi,
	I spotted this error in IndexReader.IndexExists in Lucene.Net-2.1. Not sure 
if this is already fixed in trunk.
	
public static bool IndexExists(System.IO.FileInfo directory)
{
  return 
SegmentInfos.GetCurrentSegmentGeneration(System.IO.Directory.GetFileSystemEntries(directory.FullName))
!= - 
1;
}

The above method uses Directory.GetFileSystemEntries which returns full path 
of the directory contents, whereas GetCurrentSegmentGeneration expects only 
names of the directory contents. As it is, IndexReader.IndexExists() will 
return false even for valid indexes.

- dBera

-- 
-----------------------------------------------------
Debajyoti Bera @ http://dtecht.blogspot.com
beagle / KDE fan
Mandriva / Inspiron-1100 user

Mime
View raw message