// make sure that all index files have been read or are kept open
// so that if an index update removes them we'll still have them
String filename=IndexFileNames.segmentFileName(segment, IndexFileNames.FREQ_EXTENSION);
if(cfsDir instanceof FSDirectory)
{
FSDirectory dddir=(FSDirectory)cfsDir;
freqStream = new BlockBufferInput.KeyInput(cfsDir.openInput(filename, readBufferSize), cfsDir,filename,cfsDir.getP());
if (fieldInfos.hasProx()) {
String fname=IndexFileNames.segmentFileName(segment, IndexFileNames.PROX_EXTENSION);
proxStream = BlockBufferInput.MaybeInstance(cfsDir.openInput(fname, readBufferSize), cfsDir,fname,cfsDir.getP());
} else {