diff --git a/core/src/main/java/org/elasticsearch/search/slice/DocValuesSliceQuery.java b/core/src/main/java/org/elasticsearch/search/slice/DocValuesSliceQuery.java index 4f334ebf0d1..95cafacedde 100644 --- a/core/src/main/java/org/elasticsearch/search/slice/DocValuesSliceQuery.java +++ b/core/src/main/java/org/elasticsearch/search/slice/DocValuesSliceQuery.java @@ -19,6 +19,7 @@ package org.elasticsearch.search.slice; +import com.carrotsearch.hppc.BitMixer; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.DocValues; import org.apache.lucene.index.SortedNumericDocValues; @@ -51,7 +52,7 @@ public final class DocValuesSliceQuery extends SliceQuery { public boolean get(int doc) { values.setDocument(doc); for (int i = 0; i < values.count(); i++) { - return contains(Long.hashCode(values.valueAt(i))); + return contains(BitMixer.mix(values.valueAt(i))); } return contains(0); } diff --git a/core/src/test/java/org/elasticsearch/search/slice/DocValuesSliceQueryTests.java b/core/src/test/java/org/elasticsearch/search/slice/DocValuesSliceQueryTests.java index dee2ae67914..846c411881f 100644 --- a/core/src/test/java/org/elasticsearch/search/slice/DocValuesSliceQueryTests.java +++ b/core/src/test/java/org/elasticsearch/search/slice/DocValuesSliceQueryTests.java @@ -19,6 +19,7 @@ package org.elasticsearch.search.slice; +import com.carrotsearch.hppc.BitMixer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedNumericDocValuesField; @@ -77,8 +78,8 @@ public class DocValuesSliceQueryTests extends ESTestCase { doc.add(new SortedNumericDocValuesField("intField", intValue)); doc.add(new SortedNumericDocValuesField("doubleField", doubleValue)); w.addDocument(doc); - sliceCounters1[Math.floorMod(Long.hashCode(intValue), max)] ++; - sliceCounters2[Math.floorMod(Long.hashCode(doubleValue), max)] ++; + sliceCounters1[Math.floorMod(BitMixer.mix((long) intValue), max)] ++; + sliceCounters2[Math.floorMod(BitMixer.mix(doubleValue), max)] ++; keys.add(uuid); } final IndexReader reader = w.getReader();