最近,工作中有2个项目使用到ElasticSearch(2.3.3),记录一下Elastic的从0开始的使用过程,可以作为入门参考资料。
参考
官网:https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html 。
入门干货:http://www.cnblogs.com/xing901022/category/642865.html 。
Sense参考:http://www.cnblogs.com/huangfox/p/3541714.html 。
操作ES,必须学会使用Sense,通过最基本的REST API来管理ES,查询ES。
集群状态
模板:GET http://SERVER/_template
映射:GET http://SERVER/_mapping
索引:GET http://SERVER/_cat/indices?v
_cat查看集群各种参数:http://www.cnblogs.com/xing901022/p/5365842.html
索引/映射/模板-CRUD
删除索引:DELETE http://SERVER/puma_test?pretty
新建索引:PUT http://SERVER/puma_test
添加映射:PUT http://SERVER/puma_test/_mapping/puma_test_mapping?pretty -d '{"properties":{"tag_new":{"type":"string","index":"analyzed"}}}'
查看所有映射:GET http://SERVER/ticket_order_statistic_staging/_mapping
查看所有模板:GET http://SERVER/_template
查看某个映射:GET http://SERVER/ticket_order_statistic_staging/_mapping/mapping_name
查看某个模板:GET http://SERVER/_template/template_name
映射
示例一:
PUT http://SERVER/INDEX/_mapping/logs
{
"pr