Module org.apache.lucene.codecs
Class FlatBitVectorsScorer.BitRandomVectorScorer
- java.lang.Object
-
- org.apache.lucene.codecs.bitvectors.FlatBitVectorsScorer.BitRandomVectorScorer
-
- All Implemented Interfaces:
RandomVectorScorer
- Enclosing class:
- FlatBitVectorsScorer
static class FlatBitVectorsScorer.BitRandomVectorScorer extends java.lang.Object implements RandomVectorScorer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.lucene.util.hnsw.RandomVectorScorer
RandomVectorScorer.AbstractRandomVectorScorer
-
-
Field Summary
Fields Modifier and Type Field Description private int
bitDimensions
private byte[]
query
private RandomAccessVectorValues.Bytes
vectorValues
-
Constructor Summary
Constructors Constructor Description BitRandomVectorScorer(RandomAccessVectorValues.Bytes vectorValues, byte[] query)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bits
getAcceptOrds(Bits acceptDocs)
Returns theBits
representing live documents.int
maxOrd()
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.
-
-
-
Field Detail
-
vectorValues
private final RandomAccessVectorValues.Bytes vectorValues
-
bitDimensions
private final int bitDimensions
-
query
private final byte[] query
-
-
Constructor Detail
-
BitRandomVectorScorer
BitRandomVectorScorer(RandomAccessVectorValues.Bytes vectorValues, byte[] query)
-
-
Method Detail
-
score
public float score(int node) throws java.io.IOException
Description copied from interface:RandomVectorScorer
Returns the score between the query and the provided node.- Specified by:
score
in interfaceRandomVectorScorer
- Parameters:
node
- a random node in the graph- Returns:
- the computed score
- Throws:
java.io.IOException
-
maxOrd
public int maxOrd()
- Specified by:
maxOrd
in interfaceRandomVectorScorer
- Returns:
- the maximum possible ordinal for this scorer
-
ordToDoc
public int ordToDoc(int ord)
Description copied from interface:RandomVectorScorer
Translates vector ordinal to the correct document ID. By default, this is an identity function.- Specified by:
ordToDoc
in interfaceRandomVectorScorer
- Parameters:
ord
- the vector ordinal- Returns:
- the document Id for that vector ordinal
-
getAcceptOrds
public Bits getAcceptOrds(Bits acceptDocs)
Description copied from interface:RandomVectorScorer
Returns theBits
representing live documents. By default, this is an identity function.- Specified by:
getAcceptOrds
in interfaceRandomVectorScorer
- Parameters:
acceptDocs
- the accept docs- Returns:
- the accept docs
-
-