java.lang.Object
co.elastic.clients.elasticsearch.indices.segments.Segment
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class Segment extends Object implements JsonpSerializable
See Also:
  • Field Details

  • Method Details

    • of

    • attributes

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

      API name: attributes

    • committed

      public final boolean committed()
      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 boolean compound()
      Required - If true, Lucene merged all files from the segment into a single file to save file descriptors.

      API name: compound

    • deletedDocs

      public final long deletedDocs()
      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 int generation()
      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 boolean search()
      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 double sizeInBytes()
      Required - Disk space used by the segment, in bytes.

      API name: size_in_bytes

    • numDocs

      public final long numDocs()
      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 String version()
      Required - Version of Lucene used to write the segment.

      API name: version

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • rebuild

      public Segment.Builder rebuild()
      Returns:
      New Segment.Builder initialized with field values of this instance
    • setupSegmentDeserializer

      protected static void setupSegmentDeserializer(ObjectDeserializer<Segment.Builder> op)