在动态映射elasticsearch上使用正则表达式

using regex on dynamique mapping elasticsearch

我想知道我的模板映射在 ES 5.5 上使用正则表达式是否正确。我需要过滤所有包含特定正则表达式的字段而不是对它们进行索引

文件看起来像:

attributes.imageLink@Media_link

attributes.gtinLinks@PimStd_link

我的模板映射包含 ES 匹配正则表达式:

{
                    link: {
                        path_match: 'attributes.*_link',
                        mapping: {
                            type: 'keyword',
                            index: 'analyzed',
                            copy_to: ['references', 'keyword'],
                        },
                    },
                },
                {
                    otherLink: {
                        match_pattern: 'regex',
                        match: 'gtinLinks|imageLink',
                        mapping: {
                            type: 'keyword',
                            index: 'no',
                        },
                    },
                },

我的映射终于正确了,映射

                    match_pattern: 'regex',
                    match: 'gtinLinks|imageLink',

是否过滤包含 gtinLinks|imageLink

的所有字段

我能够看到使用 _analyze API 并对文本进行一些模式匹配