Package org.apache.lucene.facet

# Record Class FacetsCollector.MatchingDocs

java.lang.Object
java.lang.Record
org.apache.lucene.facet.FacetsCollector.MatchingDocs

Record Components:
  `context` - Context for this segment.
  `bits` - Which documents were seen.
  `totalHits` - Total number of hits
  `scores` - Non-sparse scores array.

Enclosing class:
  `FacetsCollector`

public static record FacetsCollector.MatchingDocs(LeafReaderContext context, DocIdSet bits, int totalHits, float[] scores) extends Record
Holds the documents that were matched in the `LeafReaderContext`. If scores were required, then `scores` is not null.

## Constructor Summary

Constructors
Constructor
Description
`MatchingDocs(LeafReaderContext context, DocIdSet bits, int totalHits, float[] scores)`
Creates an instance of a `MatchingDocs` record class.

## Method Summary

Modifier and Type
Method
Description
`DocIdSet`
`bits()`
Returns the value of the `bits` record component.
`LeafReaderContext`
`context()`
Returns the value of the `context` record component.
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`final int`
`hashCode()`
Returns a hash code value for this object.
`float[]`
`scores()`
Returns the value of the `scores` record component.
`final String`
`toString()`
Returns a string representation of this record class.
`int`
`totalHits()`
Returns the value of the `totalHits` record component.

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### MatchingDocs

public MatchingDocs(LeafReaderContext context, DocIdSet bits, int totalHits, float[] scores)
Creates an instance of a `MatchingDocs` record class.

Parameters:
  `context` - the value for the `context` record component
  `bits` - the value for the `bits` record component
  `totalHits` - the value for the `totalHits` record component
  `scores` - the value for the `scores` record component

## Method Details

### toString

public final String toString()
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.

Specified by:
  `toString` in class `Record`
Returns:
  a string representation of this object

### hashCode

public final int hashCode()
Returns a hash code value for this object. The value is derived from the hash code of each of the record components.

Specified by:
  `hashCode` in class `Record`
Returns:
  a hash code value for this object

### equals

public final boolean equals(Object o)
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with `Objects::equals(Object,Object)`; primitive components are compared with '=='.

Specified by:
  `equals` in class `Record`
Parameters:
  `o` - the object with which to compare
Returns:
  `true` if this object is the same as the `o` argument; `false` otherwise.

### context

public LeafReaderContext context()
Returns the value of the `context` record component.

Returns:
  the value of the `context` record component

### bits

public DocIdSet bits()
Returns the value of the `bits` record component.

Returns:
  the value of the `bits` record component

### totalHits

public int totalHits()
Returns the value of the `totalHits` record component.

Returns:
  the value of the `totalHits` record component

### scores

public float[] scores()
Returns the value of the `scores` record component.

Returns:
  the value of the `scores` record component