|
17 | 17 |
|
18 | 18 | package org.apache.solr.handler.admin; |
19 | 19 |
|
| 20 | +import static org.apache.lucene.index.IndexOptions.DOCS; |
| 21 | +import static org.apache.lucene.index.IndexOptions.DOCS_AND_FREQS; |
| 22 | +import static org.apache.lucene.index.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS; |
| 23 | + |
20 | 24 | import java.io.IOException; |
21 | 25 | import java.lang.invoke.MethodHandles; |
22 | 26 | import java.net.MalformedURLException; |
|
41 | 45 | import org.apache.lucene.index.DirectoryReader; |
42 | 46 | import org.apache.lucene.index.DocValuesType; |
43 | 47 | import org.apache.lucene.index.FieldInfo; |
| 48 | +import org.apache.lucene.index.IndexCommit; |
44 | 49 | import org.apache.lucene.index.IndexOptions; |
45 | 50 | import org.apache.lucene.index.IndexReader; |
46 | 51 | import org.apache.lucene.index.IndexableField; |
|
80 | 85 | import org.slf4j.Logger; |
81 | 86 | import org.slf4j.LoggerFactory; |
82 | 87 |
|
83 | | -import static org.apache.lucene.index.IndexOptions.DOCS; |
84 | | -import static org.apache.lucene.index.IndexOptions.DOCS_AND_FREQS; |
85 | | -import static org.apache.lucene.index.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS; |
86 | | - |
87 | 88 | /** |
88 | 89 | * This handler exposes the internal lucene index. It is inspired by and |
89 | 90 | * modeled on Luke, the Lucene Index Browser by Andrzej Bialecki. |
@@ -586,8 +587,13 @@ public static SimpleOrderedMap<Object> getIndexInfo(DirectoryReader reader) thro |
586 | 587 | indexInfo.add("current", reader.isCurrent() ); |
587 | 588 | indexInfo.add("hasDeletions", reader.hasDeletions() ); |
588 | 589 | indexInfo.add("directory", dir ); |
589 | | - indexInfo.add("userData", reader.getIndexCommit().getUserData()); |
590 | | - String s = reader.getIndexCommit().getUserData().get(SolrIndexWriter.COMMIT_TIME_MSEC_KEY); |
| 590 | + IndexCommit indexCommit = reader.getIndexCommit(); |
| 591 | + String segmentsFileName = indexCommit.getSegmentsFileName(); |
| 592 | + indexInfo.add("segmentsFile", segmentsFileName); |
| 593 | + indexInfo.add("segmentsFileSizeInBytes", indexCommit.getDirectory().fileLength(segmentsFileName)); |
| 594 | + Map<String,String> userData = indexCommit.getUserData(); |
| 595 | + indexInfo.add("userData", userData); |
| 596 | + String s = userData.get(SolrIndexWriter.COMMIT_TIME_MSEC_KEY); |
591 | 597 | if (s != null) { |
592 | 598 | indexInfo.add("lastModified", new Date(Long.parseLong(s))); |
593 | 599 | } |
|
0 commit comments