- 检查文件及目录是否存在
- 所有节点配置完之后都要重启
- 检查测试脚本是否正确的,我遇到的问题就是脚本不正确但是确能执行,就是拿不到正确结果
错误脚本:
PUT test_idx_analyzer3
{"settings": {// 这里是分析器 不是分词器; 分词器可以包含设置过滤器和分词器"analysis": {// 这个有四种类型具体看官方文档"char_filter": {"test_mapping_filter1": {"type": "pattern_replace","pattern": "(\\d{3})(\\d{4})(\\d{4})","replacement": "$1***$2"}},"analyzer": {"test_analyzer2": {"tokenizer": "keyword","char_filter": ["test_mapping_filter1"]}}}}
}
正确脚本:
PUT /test_index02
{"settings": {"index": {"analysis": {"analyzer": {"test_index02_search_synonyms": {"tokenizer": "ik_max_word","filter": [ "test_index02_graph_synonyms" ]}},"filter": {"test_index02_graph_synonyms": {"type": "synonym_graph","synonyms_path": "analysis/synonyms.txt"}}}}}
}