Impacts (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.index, class: Impacts

Package org.apache.lucene.index

# Class Impacts

java.lang.Object
org.apache.lucene.index.Impacts

public abstract class Impacts extends Object
Information about upcoming impacts, ie. (freq, norm) pairs.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Impacts()`
  Sole constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract int`
  `getDocIdUpTo(int level)`
  Return the maximum inclusive doc ID until which the list of impacts returned by `getImpacts(int)` is valid.
  `abstract FreqAndNormBuffer`
  `getImpacts(int level)`
  Return impacts on the given level.
  `abstract int`
  `numLevels()`
  Return the number of levels on which we have impacts.

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

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

- ## Constructor Details

  - ### Impacts

    protected Impacts()
    Sole constructor. Typically invoked by sub classes.

- ## Method Details

  - ### numLevels

    public abstract int numLevels()
    Return the number of levels on which we have impacts. The returned value is always greater than 0 and may not always be the same, even on a single postings list, depending on the current doc ID.

  - ### getDocIdUpTo

    public abstract int getDocIdUpTo(int level)
    Return the maximum inclusive doc ID until which the list of impacts returned by `getImpacts(int)` is valid. This is a non-decreasing function of `level`.

  - ### getImpacts

    public abstract FreqAndNormBuffer getImpacts(int level)
    Return impacts on the given level. These impacts are sorted by increasing frequency and increasing unsigned norm, and only valid until the doc ID returned by `getDocIdUpTo(int)` for the same level, included. The returned buffer is never empty. NOTE: There is no guarantee that these impacts actually appear in postings, only that they trigger scores that are greater than or equal to the impacts that actually appear in postings.