* @param directory the directory to check for an index
* @return <code>true</code> if an index exists; <code>false</code> otherwise
*/
public static boolean indexExists(Directory directory) {
try {
new FindSegmentsFile(directory) {
@Override
protected Object doBody(String segmentFileName) throws IOException {
try {
new SegmentInfos().read(directory, segmentFileName);
} catch (FileNotFoundException ex) {