From 156e5bfd80d306441de222b8cdaca86a8877b4a5 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Wed, 21 Nov 2012 20:54:44 +0000 Subject: [PATCH] FC's binarySearchLookup no longer accepts null key git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1412282 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/lucene/search/FieldCacheRangeFilter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lucene/core/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java b/lucene/core/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java index 8ba3c9b5407..624e25f8b83 100644 --- a/lucene/core/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java +++ b/lucene/core/src/java/org/apache/lucene/search/FieldCacheRangeFilter.java @@ -91,8 +91,8 @@ public abstract class FieldCacheRangeFilter extends Filter { public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException { final FieldCache.DocTermsIndex fcsi = FieldCache.DEFAULT.getTermsIndex(context.reader(), field); final BytesRef spare = new BytesRef(); - final int lowerPoint = fcsi.binarySearchLookup(lowerVal == null ? null : new BytesRef(lowerVal), spare); - final int upperPoint = fcsi.binarySearchLookup(upperVal == null ? null : new BytesRef(upperVal), spare); + final int lowerPoint = lowerVal == null ? -1 : fcsi.binarySearchLookup(new BytesRef(lowerVal), spare); + final int upperPoint = upperVal == null ? -1 : fcsi.binarySearchLookup(new BytesRef(upperVal), spare); final int inclusiveLowerPoint, inclusiveUpperPoint;