mappings:
    properties:
        # "completeness" property is handled by the "completeness" dynamic template
        categories:
            type: 'keyword'
        categories_of_ancestors:
            type: 'keyword'
        family.code:
            type: 'keyword'
        # family labels are handled by the "family" dynamic template
        family_variant:
            type: 'keyword'
        id:
            type: 'keyword'
        enabled:
            type: 'boolean'
        groups:
            type: 'keyword'
        created:
            type: 'date'
        updated:
            type: 'date'
        entity_updated:
            type: 'date'
        identifier:
            type: 'keyword'
            normalizer: 'identifier_normalizer'
        document_type:
            type: 'keyword'
        attributes_of_ancestors:
            type: 'keyword'
        attributes_for_this_level:
            type: 'keyword'
        parent:
            type: 'keyword'
            normalizer: 'identifier_normalizer'
        ancestors.codes:
            type: 'keyword'
            normalizer: 'identifier_normalizer'
        ancestors.ids:
            type: 'keyword'
    dynamic_templates:
        -
            label_scopable_localizable_structure:
                path_match: 'label.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            label:
                path_match: 'label.*'
                mapping:
                    type: 'keyword'
                    normalizer: 'text_normalizer'
        -
            ancestor_label:
                path_match: 'ancestors.labels.*'
                match_mapping_type: 'string'
                mapping:
                    type: 'keyword'
                    normalizer: 'text_normalizer'
        -
            family:
                path_match: 'family.labels.*'
                mapping:
                    type: 'keyword'
                    normalizer: 'family_normalizer'
        -
            textarea_scopable_localizable_structure:
                path_match: 'values.*-textarea.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            textarea:
                path_match: 'values.*-textarea.*'
                mapping:
                    fields:
                        preprocessed:
                            type: 'text'
                            analyzer: 'textarea_preprocessed_analyzer'
                            fielddata: true
                    type: 'text'
                    analyzer: 'textarea_analyzer'
        -
            text_scopable_localizable_structure:
                path_match: 'values.*-text.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            text:
                path_match: 'values.*-text.*'
                mapping:
                    type: 'keyword'
                    normalizer: 'text_normalizer'
        -
            completeness_scopable_localizable_structure:
                path_match: 'completeness.*'
                match_mapping_type: 'object'
                mapping:
                     type: 'object'
        -
            completeness:
                path_match: 'completeness.*'
                mapping:
                     type: 'integer'
        -
            decimal_scopable_localizable_structure:
                path_match: 'values.*-decimal.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            decimal:
                path_match: 'values.*-decimal.*'
                mapping:
                    type: 'double'
        -
            boolean_scopable_localizable_structure:
                path_match: 'values.*-boolean.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            boolean:
                path_match: 'values.*-boolean.*'
                mapping:
                    type: 'boolean'
        -
            date_scopable_localizable_structure:
                path_match: 'values.*-date.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            date:
                path_match: 'values.*-date.*'
                mapping:
                    type: 'date'
        -
            option_scopable_localizable_structure:
                path_match: 'values.*-option.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            option:
                path_match: 'values.*-option.*'
                mapping:
                    type: 'keyword'
                    normalizer: 'attribute_option_normalizer'
        -
            options_scopable_localizable_structure:
                path_match: 'values.*-options.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            options:
                path_match: 'values.*-options.*'
                mapping:
                    type: 'keyword'
                    normalizer: 'attribute_option_normalizer'
        -
            reference_data_option_scopable_localizable_structure:
                path_match: 'values.*-reference_data_option.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            reference_data_option:
                path_match: 'values.*-reference_data_option.*'
                mapping:
                    type: 'keyword'
                    normalizer: 'attribute_option_normalizer'
        -
            reference_data_options_scopable_localizable_structure:
                path_match: 'values.*-reference_data_options.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            reference_data_options:
                path_match: 'values.*-reference_data_options.*'
                mapping:
                    type: 'keyword'
                    normalizer: 'attribute_option_normalizer'
        -
            prices_data_options_scopable_localizable_structure:
                path_match: 'values.*-prices.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            prices:
                path_match: 'values.*-prices.*'
                mapping:
                    type: 'double'
        -
            metric_data:
                path_match: 'values.*-metric.*.data'
                mapping:
                    index: false
        -
            metric_base_data:
                path_match: 'values.*-metric.*.base_data'
                mapping:
                    type: 'double'
        -
            metric_unit:
                path_match: 'values.*-metric.*.unit'
                mapping:
                    index: false
        -
            metric_base_unit:
                path_match: 'values.*-metric.*.base_unit'
                mapping:
                    index: false
        -
            media_extension:
                path_match: 'values.*-media.*.extension'
                mapping:
                    index: false
        -
            media_key:
                path_match: 'values.*-media.*.key'
                mapping:
                    index: false
        -
            media_hash:
                path_match: 'values.*-media.*.hash'
                mapping:
                    index: false
        -
            media_mime_type:
                path_match: 'values.*-media.*.mime_type'
                mapping:
                    index: false
        -
            media_original_filename:
                path_match: 'values.*-media.*.original_filename'
                mapping:
                    type: 'keyword'
        -
            media_size:
                path_match: 'values.*-media.*.size'
                mapping:
                    index: false
        -
            media_storage:
                path_match: 'values.*-media.*.storage'
                mapping:
                    index: false
        -
            in_group_structure:
                path_match: 'in_group.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            in_group:
                path_match: 'in_group.*'
                mapping:
                    type: 'boolean'
        -
            rates_structure:
                path_match: 'rates.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            rates:
                path_match: 'rates.*'
                mapping:
                    type: 'keyword'
        -
            data_quality_insights_structure:
                path_match: 'data_quality_insights.*'
                match_mapping_type: 'object'
                mapping:
                    type: 'object'
        -
            data_quality_insights_key_indicators:
                path_match: 'data_quality_insights.key_indicators.*'
                mapping:
                    type: 'boolean'
        -
            data_quality_insights_scores:
                path_match: 'data_quality_insights.scores.*'
                mapping:
                    type: 'short'
