ES语句构造麻烦,每次都拼,这次备份一下
1. 创建索引
PUT http://sae1002.qihoo.ai:9200/kosmos
{"settings":{"index":{"number_of_shards":1,"number_of_replicas":1},"analysis":{"filter":{"jieba_stop":{"type":"stop","stopwords_path":"stopwords/stopwords.txt"},"jieba_synonym":{"type":"synonym","synonyms_path":"synonyms/synonyms.txt"}},"analyzer":{"jieba":{"tokenizer":"jieba_index","filter":["lowercase","jieba_stop","jieba_synonym"]}}}},"mappings":{"properties":{"title":{"type":"text"},"des":{"type":"text"},"author":{"type":"keyword"},"sourceFileUrl":{"type":"keyword"},"date":{"type":"keyword"}}}}
查看索引 http://sae1002.qihoo.ai:9200/_cat/
查看设置和schema:http://sae1002.qihoo.ai:9200/kosmos/_settings http://sae1002.qihoo.ai:9200/kosmos/_mappings
手机扫一扫
移动阅读更方便
你可能感兴趣的文章