mirror of https://github.com/apache/lucene.git
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:
parent
19c3b1220b
commit
7c4c289b2e
|
@ -237,11 +237,14 @@ public final class ParallelAtomicReader extends AtomicReader {
|
||||||
@Override
|
@Override
|
||||||
public Fields getTermVectors(int docID) throws IOException {
|
public Fields getTermVectors(int docID) throws IOException {
|
||||||
ensureOpen();
|
ensureOpen();
|
||||||
ParallelFields fields = new ParallelFields();
|
ParallelFields fields = null;
|
||||||
for (Map.Entry<String,AtomicReader> ent : fieldToReader.entrySet()) {
|
for (Map.Entry<String,AtomicReader> ent : fieldToReader.entrySet()) {
|
||||||
String fieldName = ent.getKey();
|
String fieldName = ent.getKey();
|
||||||
Terms vector = ent.getValue().getTermVector(docID, fieldName);
|
Terms vector = ent.getValue().getTermVector(docID, fieldName);
|
||||||
if (vector != null) {
|
if (vector != null) {
|
||||||
|
if (fields == null) {
|
||||||
|
fields = new ParallelFields();
|
||||||
|
}
|
||||||
fields.addField(fieldName, vector);
|
fields.addField(fieldName, vector);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue