mirror of https://github.com/apache/lucene.git
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:
parent
0ec683db2f
commit
46f7f12455
|
@ -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();
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue