Elasticsearch.The.Definitive.Guide学习笔记 -- 3. Data in, Data in

1. Elastic search 原数据 index 索引 (包含一个或多个share分片),type 相当于关系型数据中的表,id 唯一主见。

2. update过程 检索文档->update->重建索引,如果是部分更新的话,就是在一个share分片上,这就是和全部更新比的区别。

3. 批量回去数据 _mget。

4. 批量ddl数据 _bulk。例子

POST /_bulk
    { "delete": { "_index": "website", "_type": "blog", "_id": "123" }}
    { "create": { "_index": "website", "_type": "blog", "_id": "123" }}
    { "title":    "My first blog post" }
    { "index":  { "_index": "website", "_type": "blog" }}
    { "title":    "My second blog post" }
    { "update": { "_index": "website", "_type": "blog", "_id": "123", "_retry_on_conflict" : 3} }
    { "doc" : {"title" : "My updated blog post"} }

5. 其他点

    查询  ?_source=title,text    /_source
    创建 /_create  ?_update
    版本号 ?_version=2&version_type=external
    POST /website/pageviews/1/_update?retry_on_conflict=5  当出现冲突重新更新
    是否存在
    curl -i -XHEAD http://localhost:9200/website/blog/123


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值