Package org.apache.lucene.util.hnsw
Interface RandomVectorScorer
-
- All Known Implementing Classes:
RandomVectorScorer.AbstractRandomVectorScorer
public interface RandomVectorScorer
ARandomVectorScorer
for scoring random nodes in batches against an abstract query.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RandomVectorScorer.AbstractRandomVectorScorer
Creates a default scorer for random access vectors.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Bits
getAcceptOrds(Bits acceptDocs)
Returns theBits
representing live documents.int
maxOrd()
default int
ordToDoc(int ord)
Translates vector ordinal to the correct document ID.float
score(int node)
Returns the score between the query and the provided node.
-
-
-
Method Detail
-
score
float score(int node) throws IOException
Returns the score between the query and the provided node.- Parameters:
node
- a random node in the graph- Returns:
- the computed score
- Throws:
IOException
-
maxOrd
int maxOrd()
- Returns:
- the maximum possible ordinal for this scorer
-
ordToDoc
default int ordToDoc(int ord)
Translates vector ordinal to the correct document ID. By default, this is an identity function.- Parameters:
ord
- the vector ordinal- Returns:
- the document Id for that vector ordinal
-
-