ElasticSearch 找不到分析器?

标签 elasticsearch elasticsearch-plugin elasticsearch-2.0

我在elasticsearch.yml中配置了全局自定义分析器,这是我的配置:

index :
analysis :
    analyzer :
        titleAnalyzer :
            type : custom
            tokenizer : ik_max_word
            filter : [titleSynoymFilter, englishStemmerFilter]
    filter :
        titleSynoymFilter :
            type : synonym
            synonyms_path : ../analysis/title_synonym.txt
        englishStemmerFilter :
            type : stemmer
            name : english

然后我通过运行命令 $ echo 'A drop in the ocean'| 来测试我的分析器。 http:5600/_analyze?analyzer=titleAnalyzer

但是elasticsearch告诉我它找不到分析器:

{
"error": {
    "reason": "failed to find analyzer [titleAnalyzer]",
    "root_cause": [
        {
            "reason": "[elastisearch][127.0.0.1:9300][indices:admin/analyze[s]]",
            "type": "remote_transport_exception"
        }
    ],
    "type": "illegal_argument_exception"
},
"status": 400
}

最佳答案

如果在根路径上调用 /_analyze 未找到分析器,请尝试在该路径上至少指定一个现有索引

$ echo 'A drop in the ocean'| http :5600/some_index/_analyze?analyzer=titleAnalyzer
                                              ^
                                              |
                                      add an index here

关于ElasticSearch 找不到分析器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37028981/

相关文章:

hadoop - Elasticsearch 5.4 更新\添加嵌套文档

elasticsearch - Elasticsearch-如何从字尾删除S

elasticsearch - 我可以获得每个域列表的计数吗?

elasticsearch - 使用Apache Lucene进行 bool 查询的结果编号

Elasticsearch bulk index api 通过 rest 端点

ElasticsearchException 绑定(bind)服务失败错误

elasticsearch - Elasticsearch 分数计算

Elasticsearch:获取当前正在运行的快照操作

elasticsearch - 排序在 Elasticsearch 中不起作用

elasticsearch - 错误 : Unrecognized VM option 'AggressiveOpts'