Weight.DefaultScorerSupplier (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.search, class: Weight, class: DefaultScorerSupplier

Package org.apache.lucene.search

# Class Weight.DefaultScorerSupplier

java.lang.Object
org.apache.lucene.search.ScorerSupplier
org.apache.lucene.search.Weight.DefaultScorerSupplier

Enclosing class:
  `Weight`

protected static final class Weight.DefaultScorerSupplier extends ScorerSupplier
A wrap for default scorer supplier.

NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultScorerSupplier(Scorer scorer)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `cost()`
  Get an estimate of the `Scorer` that would be returned by `ScorerSupplier.get(long)`.
  `Scorer`
  `get(long leadCost)`
  Get the `Scorer`.

  ### Methods inherited from class org.apache.lucene.search.ScorerSupplier

  `bulkScorer, setTopLevelScoringClause`

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

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

- ## Constructor Details

  - ### DefaultScorerSupplier

    public DefaultScorerSupplier(Scorer scorer)

- ## Method Details

  - ### get

    public Scorer get(long leadCost) throws IOException
    Description copied from class: `ScorerSupplier`
    Get the `Scorer`. This may not return `null` and must be called at most once.
    Specified by:
      `get` in class `ScorerSupplier`
    Parameters:
      `leadCost` - Cost of the scorer that will be used in order to lead iteration. This can be interpreted as an upper bound of the number of times that `DocIdSetIterator.nextDoc()`, `DocIdSetIterator.advance(int)` and `TwoPhaseIterator.matches()` will be called. Under doubt, pass `Long.MAX_VALUE`, which will produce a `Scorer` that has good iteration capabilities.
    Throws:
      `IOException`

  - ### cost

    public long cost()
    Description copied from class: `ScorerSupplier`
    Get an estimate of the `Scorer` that would be returned by `ScorerSupplier.get(long)`. This may be a costly operation, so it should only be called if necessary.
    Specified by:
      `cost` in class `ScorerSupplier`
    See Also:
      - `DocIdSetIterator.cost()`