目前,我正在评估是否以及如何将遗留的基于lucene的分析器组件移至弹性搜索(0.19.18)。由于遗留代码基于lucene,因此我将分析器封装在es-plugin中。分析仪的配置如下所示:ElasticSearch:配置自定义分析器实现
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'
将返回一个文本,是不是所有的标记化。显然,我的分析器不是只应用小写字母过滤器。索引中的对象没有正确分析。
指数映射是这样的(从头部插件输出):
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/<我的索引名称>/_ settings''时,你会得到什么? – imotov 2012-07-16 18:46:00
'{“myIndex”:{“settings”:{“index.version.created”:“190899”,“index.number_of_replicas”:“0”,“index.number_of_shards”:“1”}}}' – GLA 2012-07-17 07:49:45
有可能在某处发布repro? – imotov 2012-07-18 16:27:03