ElasticSearch基础操作

Paste_Image.png

Create an Index

PUT /customer?pretty

Index and Query a Document

PUT /customer/external/1?pretty
{
"name": "John Doe"
}

http://10.120.198.5:9200/customer/external/1?pretty/

Paste_Image.png

这时你会发现customer索引中新增了一条document记录

Paste_Image.png

http://10.120.198.5:9200/customer/external/1?pretty/

查询需要制定要查询的缩影customer,索引的类型external,文档的id pretty作用是json格式化
{
"_index" : "customer",
"_type" : "external",
"_id" : "1",
"_version" : 1,
"found" : true,
"_source" : { "name": "John Doe" }
}

Nothing out of the ordinary here other than a field, found, stating that we found a document with the requested ID 1 and another field, _source, which returns the full JSON document that we indexed from the previous step.

Delete an Index

DELETE /customer?pretty

Paste_Image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 基础概念 Elasticsearch有几个核心概念,从一开始理解这些概念会对整个学习过程有莫大的帮助。 接近实时(...
    山天大畜阅读 2,128评论 0 4
  • elasticsearch使用--简单入门(一) 一、下载安装 安装java 下载elasticsearch相应版...
    ifeelok0319阅读 363评论 0 0
  • 一些概念 索引-index: 一个索引就是一个拥有几分相似特征的文档的集合。比如说,你可以有一个客户数据的索引,另...
    perfect_jimmy阅读 3,561评论 0 0
  • 好久不用QQ开始习惯Tim了,微信呢也不太关注 刚用微信的时候很不习惯,因为每条朋友圈下面的评论,不是共同好友是看...
    走路带风的纪小姐阅读 99评论 0 1
  • 思科TechWise的这两位老兄,非常牛叉,什么都懂。当然是什么都学。 看看这个视频吧。有中文字幕。 http:/...
    taoza阅读 257评论 0 2