terms = termOrPhrase.split("\\s+");
if (terms.length > 1) {
operator = "phrase";
List<PostingsReader> prs = new ArrayList<PostingsReader>();
for (String term : terms) {
PostingsList pl = env.getPostingsList(term);
// LOG.info(term+"->"+pl.getDf());
// if any of the tokens is OOV, then the phrase is considerd OOV
if (pl == null) {
isOOV = true;
endOfList = true;
return;
}
prs.add(pl.getPostingsReader());
}
postingsReader = new ProximityPostingsReaderOrderedWindow(prs.toArray(new PostingsReader[0]), 2);
postingsReader.nextPosting(curPosting);
// ProximityPostingsReaderOrderedWindow postingsReader2 = new ProximityPostingsReaderOrderedWindow(prs, 2);
// while (postingsReader2.hasMorePostings()){
// if(postingsReader2.nextPosting(curPosting)){
// if(postingsReader2.getTf()>0){
// //LOG.info(termOrPhrase+ " docno-->"+postingsReader2.getDocno());
// //LOG.info(termOrPhrase+" tf-->"+postingsReader2.getTf());
// }
// }
// }
gte = new GlobalTermEvidence(env.getDefaultDf(), env.getDefaultCf());
this.ge = ge;
lastScoredDocno = 0;
} else {
operator = "term";
PostingsList pl = env.getPostingsList(termOrPhrase);
if (pl == null) {
isOOV = true;
endOfList = true;
} else {
postingsReader = pl.getPostingsReader();
gte = new GlobalTermEvidence(pl.getDf(), pl.getCf());
this.ge = ge;
lastScoredDocno = 0;
}
}
// //LOG.info("leaf done.");