您的位置:首页 > 产品设计 > UI/UE

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

2016-10-24 22:56 399 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: