don't add unindexed fields to fieldsenum

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1291679 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-02-21 10:01:15 +00:00
parent ceb3ab3e1d
commit 19c3b1220b
2 changed files with 4 additions and 2 deletions

View File

@ -106,7 +106,9 @@ public final class ParallelAtomicReader extends AtomicReader {
if (!fieldToReader.containsKey(fieldInfo.name)) {
fieldInfos.add(fieldInfo);
fieldToReader.put(fieldInfo.name, reader);
this.fields.addField(fieldInfo.name, reader.terms(fieldInfo.name));
if (fieldInfo.isIndexed) {
this.fields.addField(fieldInfo.name, reader.terms(fieldInfo.name));
}
}
}
}

View File

@ -256,7 +256,7 @@ public class TestTermVectors extends LuceneTestCase {
DocsEnum docs = null;
while(fields.next() != null) {
Terms terms = fields.terms();
assertNotNull(terms);
assertNotNull(terms); // NOTE: kinda sketchy assumptions, but ideally we would fix fieldsenum api...
TermsEnum termsEnum = terms.iterator(null);
while (termsEnum.next() != null) {