diff --git a/bobo-browse/src/main/java/com/browseengine/bobo/facets/data/MultiValueFacetDataCache.java b/bobo-browse/src/main/java/com/browseengine/bobo/facets/data/MultiValueFacetDataCache.java index 68b9522b..0f523dc9 100644 --- a/bobo-browse/src/main/java/com/browseengine/bobo/facets/data/MultiValueFacetDataCache.java +++ b/bobo-browse/src/main/java/com/browseengine/bobo/facets/data/MultiValueFacetDataCache.java @@ -125,6 +125,19 @@ public void load(String fieldName, AtomicReader reader, TermListFactory listF } list.seal(); + // Process minIDList and maxIDList for negative number + for (int i = 1; i < negativeValueCount/2 + 1; ++i) { + int top = i; + int tail = negativeValueCount - i + 1; + int topValue = minIDList.getInt(top); + int tailValue = minIDList.getInt(tail); + minIDList.set(top, tailValue); + minIDList.set(tail, topValue); + topValue = maxIDList.getInt(top); + tailValue = maxIDList.getInt(tail); + maxIDList.set(top, tailValue); + maxIDList.set(tail, topValue); + } try { _nestedArray.load(maxdoc + 1, loader); @@ -229,6 +242,19 @@ public void load(String fieldName, AtomicReader reader, TermListFactory listF } list.seal(); + // Process minIDList and maxIDList for negative number + for (int i = 1; i < negativeValueCount/2 + 1; ++i) { + int top = i; + int tail = negativeValueCount - i + 1; + int topValue = minIDList.getInt(top); + int tailValue = minIDList.getInt(tail); + minIDList.set(top, tailValue); + minIDList.set(tail, topValue); + topValue = maxIDList.getInt(top); + tailValue = maxIDList.getInt(tail); + maxIDList.set(top, tailValue); + maxIDList.set(tail, topValue); + } this.valArray = list; this.freqs = freqList.toIntArray(); diff --git a/bobo-browse/src/main/java/com/browseengine/bobo/facets/data/MultiValueWithWeightFacetDataCache.java b/bobo-browse/src/main/java/com/browseengine/bobo/facets/data/MultiValueWithWeightFacetDataCache.java index 6b5e8436..394eb867 100644 --- a/bobo-browse/src/main/java/com/browseengine/bobo/facets/data/MultiValueWithWeightFacetDataCache.java +++ b/bobo-browse/src/main/java/com/browseengine/bobo/facets/data/MultiValueWithWeightFacetDataCache.java @@ -133,6 +133,19 @@ public void load(String fieldName, AtomicReader reader, TermListFactory listF } list.seal(); + // Process minIDList and maxIDList for negative number + for (int i = 1; i < negativeValueCount/2 + 1; ++i) { + int top = i; + int tail = negativeValueCount - i + 1; + int topValue = minIDList.getInt(top); + int tailValue = minIDList.getInt(tail); + minIDList.set(top, tailValue); + minIDList.set(tail, topValue); + topValue = maxIDList.getInt(top); + tailValue = maxIDList.getInt(tail); + maxIDList.set(top, tailValue); + maxIDList.set(tail, topValue); + } try { _nestedArray.load(maxdoc + 1, loader);