【发布时间】:2012-07-16 13:51:45
【问题描述】:
目前我正在评估是否以及如何将基于 lucene 的遗留分析器组件移动到弹性搜索 (0.19.18)。由于遗留代码基于 lucene,我将分析器包装在 es-plugin 中。分析器的配置如下所示:
index.analysis.analyzer.myAnalyzer.type : myAnalyzer
index.analysis.analyzer.default.type: myAnalyzer
index.analysis.analyzer.default_index.type: myAnalyzer
index.analysis.analyzer.default_search.type: myAnalyzer
到目前为止一切顺利。
curl -XGET 'localhost:9200/_analyze' -d 'Some text'
将返回一个包含正确标记的文本的对象,但是
curl -XGET 'localhost:9200/<name-of-my-index>/_analyze' -d 'Some text'
将返回一个根本没有标记的文本。显然,只应用了小写过滤器而不是 myAnalyzer。索引中的对象都没有被正确分析。
索引映射如下所示(head-plugin 的输出):
mappings: {
item: {
analyzer: myAnalyzer
properties: {
id: {
type: string
}
itemnumber: {
type: string
}
articletext: {
analyzer: myAnalyzer
type: string
}
sortvalue: {
type: string
}
salesstatus: {
format: dateOptionalTime
type: date
}
}
}
}
由于我是 ES 新手,我无法弄清楚这种行为的真正原因是什么。有人有想法吗?
【问题讨论】:
-
运行
curl -XGET 'localhost:9200/<name-of-my-index>/_settings'会得到什么? -
{"myIndex":{"settings":{"index.version.created":"190899","index.number_of_replicas":"0","index.number_of_shards":"1"}}} -
是否可以在某处发布repro?
标签: lucene elasticsearch jsm