List of usage examples for org.apache.lucene.index SegmentInfos getLastGeneration
public long getLastGeneration()
From source file:org.elasticsearch.index.engine.CommitStats.java
License:Apache License
public CommitStats(SegmentInfos segmentInfos) { // clone the map to protect against concurrent changes userData = MapBuilder.<String, String>newMapBuilder().putAll(segmentInfos.getUserData()).immutableMap(); // lucene calls the current generation, last generation. generation = segmentInfos.getLastGeneration(); if (segmentInfos.getId() != null) { // id is only written starting with Lucene 5.0 id = Base64.encodeBytes(segmentInfos.getId()); }/*from w ww .ja va2 s . com*/ numDocs = Lucene.getNumDocs(segmentInfos); }