fix TestUniqueTermCount

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1433720 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2013-01-15 22:46:33 +00:00
parent 0ec683db2f
commit 46f7f12455
3 changed files with 3 additions and 0 deletions

View File

@ -210,6 +210,7 @@ public final class FieldInfo {
assert checkConsistency();
}
// nocommit type is always number? should we remove this?
void setNormValueType(DocValuesType type) {
normType = type;
assert checkConsistency();

View File

@ -43,6 +43,7 @@ final class NormsConsumerPerField extends InvertedDocEndConsumerPerField impleme
void finish() throws IOException {
if (fieldInfo.isIndexed() && !fieldInfo.omitsNorms()) {
if (consumer == null) {
fieldInfo.setNormValueType(FieldInfo.DocValuesType.NUMERIC);
consumer = new NumberDVWriter(fieldInfo, docState.docWriter.bytesUsed);
}
consumer.addValue(docState.docID, similarity.computeNorm(fieldState));

View File

@ -70,6 +70,7 @@ public class TestUniqueTermCount extends LuceneTestCase {
public void test() throws Exception {
NumericDocValues fooNorms = MultiSimpleDocValues.simpleNormValues(reader, "foo");
assertNotNull(fooNorms);
for (int i = 0; i < reader.maxDoc(); i++) {
assertEquals(expected.get(i).longValue(), fooNorms.get(i));
}