int[][] pos = new int[query.length][];
//If the lenght of the query is one, just return the first n documents
//in the postings list.
if(query.length == 1) {
CompressedPositionalPostings ps = postings.get(query[0]);
int df = dfs.get(query[0]);
if(hits > df) {
hits = df;
}
int nbBlocks = ps.getBlockCount();
int cnt = 0;
for(int i = 0; i < nbBlocks; i++) {
int bSize = ps.decompressBlock(decomp, i);
int docno = 0;
//extract features
for(int j = 0; j < bSize; j++) {
docno += decomp[j];
pos[0] = ps.decompressPositions(cnt);
int dl = docLengths.get(docno);
for(int fid = 0; fid < features.length; fid++) {
fvalues[cnt][fid] = features[fid].computeScoreWithMiniIndexes(pos, query, dl, stats);
}
if(writeOutput) {
output.write((qid + "\t" + docidLookup[docno] + "\t").getBytes());
for(int fid = 0; fid < fvalues[cnt].length; fid++) {
output.write((fvalues[cnt][fid] + " ").getBytes());
}
output.write(("\n").getBytes());
}
cnt++;
if(cnt >= hits) {
ps.close();
return fvalues;
}
}
}
ps.close();
return fvalues;
}
int[] myLow = new int[query.length];
int[] myHigh = new int[query.length];