Merge 2a31ca9cb1cef1a760ffbf609c131ffe08473d5f into fb54d8b54984f89f7dba90a18e7c3048421464c3

This commit is contained in:
Carterla8 2023-05-22 17:39:52 -05:00 committed by GitHub
commit db98fc1e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,9 +118,8 @@ private[this] class RawAnnoyQueryIndex[D <: Distance[D]](
}
}
// Annoy java lib do not expose param for numOfNodesToExplore.
// Default number is numOfTrees*numOfNeigbours.
// Simple hack is to artificially increase the numOfNeighbours to be requested and then just cap it before returning.
// The annoy-java lib does not expose the param for numOfNodesToExplore (the default value is numOfTrees*numOfNeighbours).
// As a workaround, we can artificially increase the numOfNeighbours to be requested and then cap it before returning.
private[this] def neighboursToRequest(
numOfNeighbours: Int,
annoyParams: AnnoyRuntimeParams