Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

DV fields must index empty BytesRef when field is missing

Michael McCandlessc2e535a5dcc8
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSort.java b/lucene/core/src/test/org/apache/lucene/search/TestSort.java
index 7217e208771..935f9189c45 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSort.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSort.java
@@ -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));