You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by rahul challapalli <ch...@gmail.com> on 2015/08/06 08:46:56 UTC

Creating a single segment reader

Hi,

Currently I am using the below code to create segment readers. On a
different node, I want to create a single SegmentReader. So what is the
minimum information that I need to pass to that node so that it can create
a specific SegmentReader? I am trying to avoid serializing a lot of
low-level state information.

segmentInfos = SegmentInfos.readLatestCommit(FSDirectory.open(Paths.get(selectionRoot)));
segmentsFilename = segmentInfos.getSegmentsFileName();
segmentReaders = new ArrayList<SegmentReader>();
for (SegmentCommitInfo sci : segmentInfos.asList()) {
  segmentReaders.add(new SegmentReader(sci, IOContext.READ));
}

Any help is greatly appreciated

- Rahul