List of usage examples for org.apache.lucene.index IndexFileNames fileNameFromGeneration
public static String fileNameFromGeneration(String base, String ext, long gen)
From source file:org.codelibs.elasticsearch.common.lucene.Lucene.java
License:Apache License
/** * Reads the segments infos from the given commit, failing if it fails to load *//* w w w. j ava 2 s. c om*/ public static SegmentInfos readSegmentInfos(IndexCommit commit) throws IOException { // Using commit.getSegmentsFileName() does NOT work here, have to // manually create the segment filename String filename = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", commit.getGeneration()); return SegmentInfos.readCommit(commit.getDirectory(), filename); }