Class IgnoreMalformedStoredValues

java.lang.Object
org.elasticsearch.index.mapper.IgnoreMalformedStoredValues

public abstract class IgnoreMalformedStoredValues extends Object
Saves malformed values to stored fields or binary doc values so they can be loaded for synthetic _source.
  • Field Details

  • Constructor Details

    • IgnoreMalformedStoredValues

      public IgnoreMalformedStoredValues()
  • Method Details

    • storeMalformedValueForSyntheticSource

      public static void storeMalformedValueForSyntheticSource(DocumentParserContext context, String fieldPath, XContentParser parser) throws IOException
      Stores a malformed value in binary doc values (new indices) or in stored fields (old indices) in order to support synthetic source.
      Throws:
      IOException
    • storeMalformedValueForSyntheticSource

      public static void storeMalformedValueForSyntheticSource(DocumentParserContext context, String fieldPath, XContentBuilder builder) throws IOException
      Stores a malformed value in binary doc values (new indices) or in stored fields (old indices) in order to support synthetic source.
      Throws:
      IOException
    • storedField

      public static org.apache.lucene.document.StoredField storedField(String name, XContentParser parser) throws IOException
      Creates a stored field that stores malformed data to be used in synthetic source. Name of the stored field is original name of the field with added conventional suffix.
      Parameters:
      name - original name of the field
      parser - parser to grab field content from
      Returns:
      Throws:
      IOException
    • storedField

      public static org.apache.lucene.document.StoredField storedField(String name, XContentBuilder builder) throws IOException
      Creates a stored field that stores malformed data to be used in synthetic source. Name of the stored field is original name of the field with added conventional suffix.
      Parameters:
      name - original name of the field
      builder - malformed data
      Returns:
      Throws:
      IOException
    • empty

      public static IgnoreMalformedStoredValues empty()
      Build a IgnoreMalformedStoredValues that never contains any values.
    • stored

      public static IgnoreMalformedStoredValues stored(String fieldName)
      Build a IgnoreMalformedStoredValues that loads from stored fields.
    • forSyntheticSource

      public static IgnoreMalformedStoredValues forSyntheticSource(String fieldName, IndexVersion indexVersion)
      Build the appropriate IgnoreMalformedStoredValues for loading malformed values during synthetic source reconstruction. Uses binary doc values for new indices and stored fields for old indices.
    • storedFieldLoaders

      A Stream mapping stored field paths to a place to put them so they can be included in the next document.
    • docValuesLoader

      public SourceLoader.SyntheticFieldLoader.DocValuesLoader docValuesLoader(org.apache.lucene.index.LeafReader reader) throws IOException
      Create a doc values loader for loading malformed values from binary doc values. Returns null if this implementation does not use doc values or if there are no doc values to load.
      Throws:
      IOException
    • count

      public abstract int count()
      How many values has this field loaded for this document?
    • write

      public abstract void write(XContentBuilder b) throws IOException
      Write values for this document.
      Throws:
      IOException
    • reset

      public abstract void reset()
      Remove stored values for this document and return to clean state to process next document.
    • name

      public static String name(String fieldName)