From c2e535a5dcc8f85f21b54f1ff910d40779298cd1 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Thu, 24 Jan 2013 22:23:53 +0000 Subject: [PATCH] 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 --- .../src/test/org/apache/lucene/search/TestSort.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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));