LUCENE-10384: Simplify LongHeap small addition (#623)

LUCENE-10384 and PR#615 introduced encoding f into NeighborQueue.
But one function `nodes()` was remained to add this encoding.

Also modify the test that would fail without this patch.
This commit is contained in:
Mayya Sharipova 2022-01-25 11:43:40 -05:00 committed by GitHub
parent 11006fba59
commit 1a4f838fe2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -100,7 +100,7 @@ public class NeighborQueue {
int size = size();
int[] nodes = new int[size];
for (int i = 0; i < size; i++) {
nodes[i] = (int) heap.get(i + 1);
nodes[i] = (int) order.apply(heap.get(i + 1));
}
return nodes;
}

View File

@ -201,7 +201,7 @@ public class TestHnswGraph extends LuceneTestCase {
CircularVectorValues vectors = new CircularVectorValues(nDoc);
HnswGraphBuilder builder =
new HnswGraphBuilder(
vectors, VectorSimilarityFunction.DOT_PRODUCT, 16, 100, random().nextInt());
vectors, VectorSimilarityFunction.EUCLIDEAN, 16, 100, random().nextInt());
HnswGraph hnsw = builder.build(vectors);
// Skip over half of the documents that are closest to the query vector
@ -215,7 +215,7 @@ public class TestHnswGraph extends LuceneTestCase {
10,
10,
vectors.randomAccess(),
VectorSimilarityFunction.DOT_PRODUCT,
VectorSimilarityFunction.EUCLIDEAN,
hnsw,
acceptOrds,
new SplittableRandom(random().nextLong()));