elasticsearch的基本用法
开始学习使用 elasticsearch, 把步骤记录在这里: 最大的特点: 1. 数据库的 database, 就是 index 2. 数据库的 table, 就是 tag 3. 不要使用browser, 使用curl来进行客户端操作. 否则会出现 java heap ooxx... curl: -X 后面跟 RESTful : GET, POST ... -d 后面跟数据。 (d = data to send) 1. create: 指定 ID 来建立新记录。 (貌似PUT, POST都可以) $ curl -XPOST localhost:9200/films/md/2 -d ' { "name":"hei yi ren", "tag": "good"}' 使用自动生成的 ID 建立新纪录: $ curl -XPOST localhost:9200/films/md -d ' { "name":"ma da jia si jia3", "tag": "good"}' 2. 查询: 2.1 查询所有的 index, type: $ curl localhost:9200/_search?pretty=true 2.2 查询某个index下所有的type: $ curl localhost:9200/films/_search 2.3 查询某个index 下, 某个