return collectionSize;
}
public PostingsReader getPostingsReader(Expression exp) {
//LOG.info("**getPostingsReader("+exp+")");;
PostingsReader postingsReader = null;
try {
if (exp.getType().equals(Expression.Type.OD)) {
int gapSize = exp.getWindow();
String[] terms = exp.getTerms();
List<PostingsReader> readers = new ArrayList<PostingsReader>();
for (int i = 0; i < terms.length; i++) {
PostingsReader reader = constructPostingsReader(terms[i]);
if(reader != null)
readers.add(reader);
}
postingsReader = new ProximityPostingsReaderOrderedWindow(readers.toArray(new PostingsReader[0]), gapSize);
} else if (exp.getType().equals(Expression.Type.UW)) {
int windowSize = exp.getWindow();
String[] terms = exp.getTerms();
List<PostingsReader> readers = new ArrayList<PostingsReader>();
for (int i = 0; i < terms.length; i++) {
PostingsReader reader = constructPostingsReader(terms[i]);
if(reader != null)
readers.add(reader);
}
postingsReader = new ProximityPostingsReaderUnorderedWindow(readers.toArray(new PostingsReader[0]), windowSize);