【发布时间】:2012-08-11 10:44:10
【问题描述】:
我有一个带有大型附件的对象被索引到 Elasticsearch 中,我不想将其存储在 _source 中。在映射中指定“排除”修复了该问题(感谢此处回答的另一个问题),但是当我为过滤器/分析器添加自定义设置时,它以某种方式破坏了排除,我想知道这是轮胎问题还是它只需要以不同的方式指定排除项。
代码如下:
settings analysis: {
filter: {
ngram_filter: {
type: "nGram",
min_gram: 2,
max_gram: 12
}
},
index_analyzer: {
index_ngram_analyzer: {
type: "custom",
tokenizer: "standard",
filter: ["lowercase", "ngram_filter"]
}
},
search_analyzer: {
search_ngram_analyzer: {
type: "custom",
tokenizer: "standard",
filter: ["standard", "lowercase", "ngram_filter"]
}
}
} do
mapping :_source => { :excludes => ['attachment'] } do
indexes :id, :type => 'integer'
[:title, :abstract].each do |attribute|
indexes attribute, type: 'string', analyzer: 'ngram_analyzer'
end
indexes :attachment, :type => 'attachment'
end
end
在我添加了“设置”块之前,带有“:excludes”的“映射”行一直在起作用,因此有关此的某些内容导致排除被忽略。有什么想法吗?提前致谢!
【问题讨论】:
标签: elasticsearch tire