在 dynamique 映射 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 并对文本进行一些模式匹配

最新更新