Fix another bug in ParallelAtomicReader: Term vectors method should return null if no term vectors are there.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1291688 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2012-02-21 10:12:37 +00:00
parent 19c3b1220b
commit 7c4c289b2e
1 changed files with 4 additions and 1 deletions

View File

@ -237,11 +237,14 @@ public final class ParallelAtomicReader extends AtomicReader {
@Override
public Fields getTermVectors(int docID) throws IOException {
ensureOpen();
ParallelFields fields = new ParallelFields();
ParallelFields fields = null;
for (Map.Entry<String,AtomicReader> ent : fieldToReader.entrySet()) {
String fieldName = ent.getKey();
Terms vector = ent.getValue().getTermVector(docID, fieldName);
if (vector != null) {
if (fields == null) {
fields = new ParallelFields();
}
fields.addField(fieldName, vector);
}
}