ColumnBatch (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.document.column, class: ColumnBatch

Package org.apache.lucene.document.column

# Class ColumnBatch

java.lang.Object
org.apache.lucene.document.column.ColumnBatch

public abstract class ColumnBatch extends Object
A column-oriented batch of documents for indexing. A Batch contains a collection of `Column`s, where each Column represents a single field across all documents in the batch. Documents are identified by batch-local IDs from 0 (inclusive) to `numDocs()` (exclusive).

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ColumnBatch()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract Iterable<Column>`
  `columns()`
  Returns the columns in this batch.
  `abstract int`
  `numDocs()`
  Returns the number of documents in this batch.

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

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

- ## Constructor Details

  - ### ColumnBatch

    public ColumnBatch()

- ## Method Details

  - ### numDocs

    public abstract int numDocs()
    Returns the number of documents in this batch. All column doc-ids must be in the range [0, numDocs()).

  - ### columns

    public abstract Iterable<Column> columns()
    Returns the columns in this batch. Each column covers one indexing feature (inversion, stored, doc values, points, or vectors) of a field across all documents in the batch.

    Multiple columns may share a field name to combine distinct features — for example, a stored `BinaryColumn` alongside a separate inverted column for the same field — but each feature must be carried by exactly one column. Multi-valued fields must use a single column whose tuple cursor emits multiple values per doc-id; a feature must not be split across columns.