目前,我正在評估是否以及如何將遺留的基於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