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

来源:互联网 发布:南风知我意1免费阅读 编辑:程序博客网 时间:2024/06/07 06:35

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
原创粉丝点击