我刚刚安装并测试了elasticsearch,它看起来很棒,我需要知道一些东西,我有一个配置文件
elasticsearch.json在config目录中
elasticsearch.json
config
{ "network" : { "host" : "127.0.0.1" }, "index" : { "number_of_shards": 3, "number_of_replicas": 1, "refresh_interval" : "2s", "analysis" : { "analyzer" : { "index_analyzer" : { "tokenizer" : "nGram", "filter" : ["lowercase"] }, "search_analyzer" : { "tokenizer" : "nGram", "filter" : ["lowercase"] } }, "// you'll need lucene dep for this: filter" : { "snowball": { "type" : "snowball", "language" : "English" } } } } }
并且我插入了一个包含一个单词的文档,searching如果我搜索关键字, search它说什么也没找到…
searching
search
在索引之前它不会干或我在配置中错过了一些东西....
您的查询看起来如何?
您的配置看起来不太好。尝试:
... "index_analyzer" : { "tokenizer" : "nGram", "filter" : ["lowercase", "snowball"] }, "search_analyzer" : { "tokenizer" : "nGram", "filter" : ["lowercase", "snowball"] } }, "filter" : { "snowball": { "type" : "snowball", "language" : "English" } }