RandomVectorScorer.AbstractRandomVectorScorer (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.util.hnsw, interface: RandomVectorScorer, class: AbstractRandomVectorScorer

Package org.apache.lucene.util.hnsw

# Class RandomVectorScorer.AbstractRandomVectorScorer

java.lang.Object
org.apache.lucene.util.hnsw.RandomVectorScorer.AbstractRandomVectorScorer

All Implemented Interfaces:
  `HasKnnVectorValues`, `RandomVectorScorer`

Enclosing interface:
  `RandomVectorScorer`

public abstract static class RandomVectorScorer.AbstractRandomVectorScorer extends Object implements RandomVectorScorer, HasKnnVectorValues
Creates a default scorer for random access vectors.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface org.apache.lucene.util.hnsw.RandomVectorScorer

  `RandomVectorScorer.AbstractRandomVectorScorer`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractRandomVectorScorer(KnnVectorValues values)`
  Creates a new scorer for the given vector values.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Bits`
  `getAcceptOrds(Bits acceptDocs)`
  Returns the `Bits` representing live documents.
  `int`
  `maxOrd()`
  `int`
  `ordToDoc(int ord)`
  Translates vector ordinal to the correct document ID.
  `KnnVectorValues`
  `values()`
  Returns the backing vector values, or null.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.apache.lucene.util.hnsw.RandomVectorScorer

  `bulkScore, score`

- ## Constructor Details

  - ### AbstractRandomVectorScorer

    public AbstractRandomVectorScorer(KnnVectorValues values)
    Creates a new scorer for the given vector values.
    Parameters:
      `values` - the vector values

- ## Method Details

  - ### maxOrd

    public int maxOrd()
    Specified by:
      `maxOrd` in interface `RandomVectorScorer`
    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 interface `RandomVectorScorer`
    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 the `Bits` representing live documents. By default, this is an identity function.
    Specified by:
      `getAcceptOrds` in interface `RandomVectorScorer`
    Parameters:
      `acceptDocs` - the accept docs
    Returns:
      the accept docs

  - ### values

    public KnnVectorValues values()
    Description copied from interface: `HasKnnVectorValues`
    Returns the backing vector values, or null.
    Specified by:
      `values` in interface `HasKnnVectorValues`