DV fields must index empty BytesRef when field is missing

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1438228 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2013-01-24 22:23:53 +00:00
parent a1aacefde1
commit c2e535a5dc
1 changed files with 11 additions and 0 deletions

View File

@ -170,6 +170,17 @@ public class TestSort extends LuceneTestCase {
default:
throw new IllegalStateException("unknown type " + stringDVType);
}
} else {
switch(stringDVType) {
case SORTED:
doc.add(new SortedDocValuesField("string_dv", new BytesRef()));
break;
case BINARY:
doc.add(new BinaryDocValuesField("string_dv", new BytesRef()));
break;
default:
throw new IllegalStateException("unknown type " + stringDVType);
}
}
if (data[i][5] != null) doc.add(new StringField("custom", data[i][5], Field.Store.NO));
if (data[i][6] != null) doc.add(new StringField("i18n", data[i][6], Field.Store.NO));