always send distance threshold in NearestNeighborItem
@@ -80,14 +80,16 @@ public class NearestNeighborItem extends SimpleTaggableItem {
putString(field, buffer);
putString(queryTensorName, buffer);
int approxNum = (approximate ? 1 : 0);
- // should become always-true later:
- boolean sendDistanceThreshold = (distanceThreshold < Double.POSITIVE_INFINITY);
+ // XXX remove this flag later, after backend change:
+ boolean sendDistanceThreshold = true;
if (sendDistanceThreshold) {
+ // XXX and remove this bit:
approxNum |= 0x40; // temporary flag bit
}
IntegerCompressor.putCompressedPositiveNumber(targetNumHits, buffer);
IntegerCompressor.putCompressedPositiveNumber(approxNum, buffer);
IntegerCompressor.putCompressedPositiveNumber(hnswExploreAdditionalHits, buffer);
+ // XXX and remove this if:
if (sendDistanceThreshold) {
buffer.putDouble(distanceThreshold);
}
