Class Segment.Builder

All Implemented Interfaces:
WithJson<Segment.Builder>, ObjectBuilder<Segment>
Enclosing class:
Segment

public static class Segment.Builder extends WithJsonObjectBuilderBase<Segment.Builder> implements ObjectBuilder<Segment>
Builder for Segment.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • attributes

      public final Segment.Builder attributes(Map<String,String> map)
      Required - Contains information about whether high compression was enabled and per-field vector formats.

      API name: attributes

      Adds all entries of map to attributes.

    • attributes

      public final Segment.Builder attributes(String key, String value)
      Required - Contains information about whether high compression was enabled and per-field vector formats.

      API name: attributes

      Adds an entry to attributes.

    • committed

      public final Segment.Builder committed(boolean value)
      Required - If true, the segment is synced to disk. Segments that are synced can survive a hard reboot. If false, the data from uncommitted segments is also stored in the transaction log so that Elasticsearch is able to replay changes on the next start.

      API name: committed

    • compound

      public final Segment.Builder compound(boolean value)
      Required - If true, Lucene merged all files from the segment into a single file to save file descriptors.

      API name: compound

    • deletedDocs

      public final Segment.Builder deletedDocs(long value)
      Required - The number of deleted documents as reported by Lucene, which may be higher or lower than the number of delete operations you have performed. This number excludes deletes that were performed recently and do not yet belong to a segment. Deleted documents are cleaned up by the automatic merge process if it makes sense to do so. Also, Elasticsearch creates extra deleted documents to internally track the recent history of operations on a shard.

      API name: deleted_docs

    • generation

      public final Segment.Builder generation(int value)
      Required - Generation number, such as 0. Elasticsearch increments this generation number for each segment written then uses this number to derive the segment name.

      API name: generation

    • search

      public final Segment.Builder search(boolean value)
      Required - If true, the segment is searchable. If false, the segment has most likely been written to disk but needs a refresh to be searchable.

      API name: search

    • sizeInBytes

      public final Segment.Builder sizeInBytes(double value)
      Required - Disk space used by the segment, in bytes.

      API name: size_in_bytes

    • numDocs

      public final Segment.Builder numDocs(long value)
      Required - The number of documents as reported by Lucene. This excludes deleted documents and counts any nested documents separately from their parents. It also excludes documents which were indexed recently and do not yet belong to a segment.

      API name: num_docs

    • version

      public final Segment.Builder version(String value)
      Required - Version of Lucene used to write the segment.

      API name: version

    • self

      protected Segment.Builder self()
      Specified by:
      self in class WithJsonObjectBuilderBase<Segment.Builder>
    • build

      public Segment build()
      Builds a Segment.
      Specified by:
      build in interface ObjectBuilder<Segment>
      Throws:
      NullPointerException - if some of the required fields are null.