Enrichment

public struct Enrichment : Codable, Equatable

Enrichment step to perform on the document. Each enrichment is performed on the specified field in the order that they are listed in the configuration.

  • Describes what the enrichment step does.

    Declaration

    Swift

    public var description: String?
  • Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if text is a top-level field with no sub-fields, text.foo is a valid destination but text.foo.bar is not.

    Declaration

    Swift

    public var destinationField: String
  • Field to be enriched. Arrays can be specified as the source_field if the enrichment service for this enrichment is set to natural_language_undstanding.

    Declaration

    Swift

    public var sourceField: String
  • Indicates that the enrichments will overwrite the destination_field field if it already exists.

    Declaration

    Swift

    public var overwrite: Bool?
  • Name of the enrichment service to call. Current options are natural_language_understanding and elements. When using natual_language_understanding, the options object must contain Natural Language Understanding options. When using elements the options object must contain Element Classification options. Additionally, when using the elements enrichment the configuration specified and files ingested must meet all the criteria specified in the documentation.

    Declaration

    Swift

    public var enrichment: String
  • If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.

    Declaration

    Swift

    public var ignoreDownstreamErrors: Bool?
  • Options which are specific to a particular enrichment.

    Declaration

    Swift

    public var options: EnrichmentOptions?
  • Initialize a Enrichment with member variables.

    Declaration

    Swift

    public init(
        destinationField: String,
        sourceField: String,
        enrichment: String,
        description: String? = nil,
        overwrite: Bool? = nil,
        ignoreDownstreamErrors: Bool? = nil,
        options: EnrichmentOptions? = nil
    )

    Parameters

    destinationField

    Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if text is a top-level field with no sub-fields, text.foo is a valid destination but text.foo.bar is not.

    sourceField

    Field to be enriched. Arrays can be specified as the source_field if the enrichment service for this enrichment is set to natural_language_undstanding.

    enrichment

    Name of the enrichment service to call. Current options are natural_language_understanding and elements. When using natual_language_understanding, the options object must contain Natural Language Understanding options. When using elements the options object must contain Element Classification options. Additionally, when using the elements enrichment the configuration specified and files ingested must meet all the criteria specified in the documentation.

    description

    Describes what the enrichment step does.

    overwrite

    Indicates that the enrichments will overwrite the destination_field field if it already exists.

    ignoreDownstreamErrors

    If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.

    options

    Options which are specific to a particular enrichment.

    Return Value

    An initialized Enrichment.