From bcf2913b9f5662ee89af62cb8a6a94094f5af617 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Fri, 8 Jan 2016 14:13:36 +0000 Subject: [PATCH] LUCENE-6962: fix simple text dim values: writer was missing newlines, and max was incorrectly returning min git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1723728 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/codecs/simpletext/SimpleTextDimensionalReader.java | 2 +- .../lucene/codecs/simpletext/SimpleTextDimensionalWriter.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalReader.java b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalReader.java index 8e0983c8772..800e174a497 100644 --- a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalReader.java +++ b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalReader.java @@ -225,7 +225,7 @@ class SimpleTextDimensionalReader extends DimensionalReader { // now all docs having this dimensional field were deleted in this segment: return null; } - return bkdReader.getMinPackedValue(); + return bkdReader.getMaxPackedValue(); } @Override diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalWriter.java b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalWriter.java index 64c0899ba80..268fddcf182 100644 --- a/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalWriter.java +++ b/lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextDimensionalWriter.java @@ -95,10 +95,12 @@ class SimpleTextDimensionalWriter extends DimensionalWriter { write(out, MIN_VALUE); BytesRef br = new BytesRef(minPackedValue, 0, minPackedValue.length); write(out, br.toString()); + newline(out); write(out, MAX_VALUE); br = new BytesRef(maxPackedValue, 0, maxPackedValue.length); write(out, br.toString()); + newline(out); for(int i=0;i