コード例 #1
0
 public SimpleTextTermVectorsReader(Directory directory, SegmentInfo si, IOContext context)
     throws IOException {
   boolean success = false;
   try {
     in =
         directory.openInput(
             IndexFileNames.segmentFileName(si.name, "", VECTORS_EXTENSION), context);
     success = true;
   } finally {
     if (!success) {
       try {
         close();
       } catch (Throwable t) {
       } // ensure we throw our original exception
     }
   }
   readIndex(si.maxDoc());
 }
コード例 #2
0
 public SimpleTextStoredFieldsReader(
     Directory directory, SegmentInfo si, FieldInfos fn, IOContext context) throws IOException {
   this.fieldInfos = fn;
   boolean success = false;
   try {
     in =
         directory.openInput(
             IndexFileNames.segmentFileName(
                 si.name, "", SimpleTextStoredFieldsWriter.FIELDS_EXTENSION),
             context);
     success = true;
   } finally {
     if (!success) {
       try {
         close();
       } catch (Throwable t) {
       } // ensure we throw our original exception
     }
   }
   readIndex(si.maxDoc());
 }