java.lang.Object
co.elastic.clients.elasticsearch.core.reindex.Source
All Implemented Interfaces:
JsonpSerializable

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

  • Method Details

    • of

    • index

      public final List<String> index()
      Required - The name of the data stream, index, or alias you are copying from. It accepts a comma-separated list to reindex from multiple sources.

      API name: index

    • query

      @Nullable public final Query query()
      The documents to reindex, which is defined with Query DSL.

      API name: query

    • remote

      @Nullable public final RemoteSource remote()
      A remote instance of Elasticsearch that you want to index from.

      API name: remote

    • size

      @Nullable public final Integer size()
      The number of documents to index per batch. Use it when you are indexing from remote to ensure that the batches fit within the on-heap buffer, which defaults to a maximum size of 100 MB.

      API name: size

    • slice

      @Nullable public final SlicedScroll slice()
      Slice the reindex request manually using the provided slice ID and total number of slices.

      API name: slice

    • sort

      @Deprecated public final List<SortOptions> sort()
      Deprecated.
      7.6.0
      A comma-separated list of <field>:<direction> pairs to sort by before indexing. Use it in conjunction with max_docs to control what documents are reindexed.

      WARNING: Sort in reindex is deprecated. Sorting in reindex was never guaranteed to index documents in order and prevents further development of reindex such as resilience and performance improvements. If used in combination with max_docs, consider using a query filter instead.

      API name: sort

    • sourceFields

      public final List<String> sourceFields()
      If true, reindex all source fields. Set it to a list to reindex select fields.

      API name: _source

    • runtimeMappings

      public final Map<String,RuntimeField> runtimeMappings()
      API name: runtime_mappings
    • 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
    • setupSourceDeserializer

      protected static void setupSourceDeserializer(ObjectDeserializer<Source.Builder> op)