05_Elasticsearch 单模式下API的增删改查操作
05_Elasticsearch 单模式下API的增删改查操作 安装marvel 插件:
zjtest7-redis:/usr/local/elasticsearch-2.3.4# bin/plugin install license
-> Installing license...
Trying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/license/2.3.4/license-2.3.4.zip ...
Downloading .......DONE
Verifying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/license/2.3.4/license-2.3.4.zip checksums if available ...
Downloading .DONE
Installed license into /usr/local/elasticsearch-2.3.4/plugins/license zjtest7-redis:/usr/local/elasticsearch-2.3.4# bin/plugin install marvel-agent
-> Installing marvel-agent...
Trying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/marvel-agent/2.3.4/marvel-agent-2.3.4.zip ...
Downloading ..........DONE
Verifying https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/marvel-agent/2.3.4/marvel-agent-2.3.4.zip checksums if available ...
Downloading .DONE
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: plugin requires additional permissions @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.lang.RuntimePermission setFactory
* javax.net.ssl.SSLPermission setHostnameVerifier
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks. Continue with installation? [y/N]y
Installed marvel-agent into /usr/local/elasticsearch-2.3.4/plugins/marvel-agent
zjtest7-redis:/usr/local/elasticsearch-2.3.4# ./elasticsearch/bin/plugin install marvel-agent
./kiabana/bin/kibana plugin --install elasticsearch/marvel/latest 5.1 索引初始化操作; 创建索引之前可以对索引做初始化操作, 比如指定shards数量以及replicas的数量 http://192.168.32.81:9200/library/
PUT
{"settings":{"number_of_shards":3,"number_of_replicas":0}} GET 方法:
http://192.168.32.81:9200/library/
GET
查询 { "library": {
"aliases": { },
"mappings": { },
"settings": {
"index": {
"creation_date": "1473139251510",
"number_of_shards": "3",
"number_of_replicas": "0",
"uuid": "EWWTPObRSpKyQW8pVgWYGQ",
"version": {
"created": "2030499"
}
}
},
"warmers": { }
} } 获取内容;
http://192.168.32.81:9200/library/_settings/
GET { "library": {
"settings": {
"index": {
"creation_date": "1473139251510",
"number_of_shards": "3",
"number_of_replicas": "0",
"uuid": "EWWTPObRSpKyQW8pVgWYGQ",
"version": {
"created": "2030499"
}
}
}
} } 5.2 通过API创建,删除索引 索引名称
|
| |Type名称
| |
PUT /library/books/1 --文档ID http://192.168.32.81:9200/library/books/1/
PUT
{
"title":"Elasticsearch:The scan",
"name" : {
"first":"aaa",
"last" :"bbb"
},
"publish_date":"2016-09-06",
"price":"49"
} 通过_source获取指定字段名称: http://192.168.32.81:9200/
library/books/1/?_source=price GET 返回:
{ "_index": "library",
"_type": "books",
"_id": "1",
"_version": 10,
"found": true,
"_source": {
"price": "49"
} } 更新:
http://192.168.32.81:9200/
library/books/1/_update POST {
"doc":{
"price":10.001
}
}
05_Elasticsearch 单模式下API的增删改查操作的更多相关文章
- Elasticsearch 单模式下API的增删改查操作
<pre name="code" class="html">Elasticsearch 单模式下API的增删改查操作 http://192.168. ...
- Elasticsearch学习系列之单模式下API的增删改查操作
这里我们通过Elasticsearch的marvel插件实现单模式下API的增删改查操作 索引的初始化操作 创建索引之前可以对索引进行初始化操作,比如先指定shard数量以及replicas的数量 代 ...
- Django项目的创建与介绍.应用的创建与介绍.启动项目.pycharm创建启动项目.生命周期.三件套.静态文件.请求及数据.配置Mysql完成数据迁移.单表ORM记录的增删改查
一.Django项目的创建与介绍 ''' 安装Django #在cmd中输入pip3 #出现这个错误Fatal error in launcher: Unable to create process ...
- Hadoop基础-HDFS的API实现增删改查
Hadoop基础-HDFS的API实现增删改查 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 本篇博客开发IDE使用的是Idea,如果没有安装Idea软件的可以去下载安装,如何安装 ...
- MongoDB(二)-- Java API 实现增删改查
一.下载jar包 http://central.maven.org/maven2/org/mongodb/mongo-java-driver/ 二.代码实现 package com.xbq.mongo ...
- (转)SQLite数据库增删改查操作
原文:http://www.cnblogs.com/linjiqin/archive/2011/05/26/2059182.html SQLite数据库增删改查操作 一.使用嵌入式关系型SQLite数 ...
- Android SQLite 数据库 增删改查操作
Android SQLite 数据库 增删改查操作 转载▼ 一.使用嵌入式关系型SQLite数据库存储数据 在Android平台上,集成了一个嵌入式关系型数据库--SQLite,SQLite3支持NU ...
- Hibernate5笔记2--单表的增删改查操作
单表的增删改查操作: (1)定义获取Session和SessionFactory的工具类: package com.tongji.utils; import org.hibernate.Session ...
- 【OF框架】新建库表及对应实体,并实现简单的增删改查操作,封装操作标准WebApi
准备 搭建好项目框架及数据库,了解框架规范. 1.数据库表和实体一一对应,表名实体名名字相同,用小写,下划线连接.字段名用驼峰命名法,首字母大写. 2.实体放在Entities目录下,继承Entity ...
随机推荐
- cf437A The Child and Homework
A. The Child and Homework time limit per test 1 second memory limit per test 256 megabytes input sta ...
- ACM2136
/* Problem Description Everybody knows any number can be combined by the prime number. Now, your tas ...
- 【剑指offer】面试题42:翻转单词顺序 VS 左旋转字符串
题目: 汇编语言中有一种移位指令叫做循环左移(ROL),现在有个简单的任务,就是用字符串模拟这个指令的运算结果.对于一个给定的字符序列S,请你把其循环左移K位后的序列输出.例如,字符序列S=”abcX ...
- puppet证书重申
- java 读取mysql库表数据
import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import ...
- CentOS7 定时检测进程占用内存大小,执行重启进程操作(xjl456852原创)
在使用CentOS时,个别程序的进程会一直增大,直到宕机.但是这种程序本身有没有更好的版本使用(比如ngrok免费就这样,付费的就没这个问题),所以想写一个脚本定时检测一下这个程序的情况,决定是否需要 ...
- Css中的变形及过渡动画
在css3的标准中新增加了变形样式,这些样式使得网页中各元素的位置形状的变换变得更加容易.其语法如下: transform:none | <transform-function>+ 其中对 ...
- codeforces C. Cd and pwd commands 执行命令行
执行命令来改变路径 cd 并显示路径命令 pwd 一个节目的 抽样: input 7 pwd cd /home/vasya pwd cd .. pwd cd vasya/../petya pwd ou ...
- Python进阶之路---1.3python环境搭建
python环境安装 windows python环境安装 下载安装包 https://www.python.org/downloads/ 安装并指定安装目录 C:\python2 ...
- WebApi2官网学习记录--- Authentication与Authorization
Authentication(认证) WebAPI中的认证既可以使用HttpModel也可以使用HTTP message handler,具体使用哪个可以参考一下依据: 一个HttpModel可以 ...