Class TestIngestDocument

java.lang.Object
org.elasticsearch.ingest.TestIngestDocument

public class TestIngestDocument extends Object
Construct ingest documents for testing purposes
  • Field Details

  • Constructor Details

    • TestIngestDocument

      public TestIngestDocument()
  • Method Details

    • withDefaultVersion

      public static IngestDocument withDefaultVersion(Map<String,Object> sourceAndMetadata, Map<String,Object> ingestMetadata)
      Create an IngestDocument from the given sourceAndMetadata and ingestMetadata and a version validator that allows null _versions. Normally null _version is not allowed, but many tests don't care about that invariant.
    • withDefaultVersion

      public static IngestDocument withDefaultVersion(Map<String,Object> sourceAndMetadata)
      Create an IngestDocument with DEFAULT_VERSION as the _version metadata, if _version is not already present.
    • emptyIngestDocument

      public static IngestDocument emptyIngestDocument()
      Create an empty ingest document for testing.

      Adds the required "_version" metadata key with value DEFAULT_VERSION.

    • randomMetadata

      public static org.elasticsearch.core.Tuple<String,Object> randomMetadata()
    • randomVersion

      public static long randomVersion()