• ES 使用笔记


    ES 使用笔记


    1、操作

    update:
      由于Lucene中的update其实就是覆盖替换,并不支持针对特定Field进行修改,Elasticsearch中的update为了实现针对特定字段修改,在Lucene的基础上做了一些改动。
    index:
      检查_version。如果插入时没有指定_version,那对于已有的doc,_version会递增,并对文档覆盖。插入时如果指定_version,如果与已有的文档_version不相等,则插入失败,如果相等则覆盖,_version递增。
    create:
      检查_version,但是对于已有的文档,不会创建新文档,即插入失败。

    bulk:
    单个请求中一次执行多个索引或者删除操作,使用这种方式可以极大的提升索引性能。
    用法:

    • /_bulk  
    • /{index}/_bulk
    • /{index}/{type}/_bulk

    参考:

    https://blog.csdn.net/xiaoyu_BD/article/details/81914567
    https://blog.csdn.net/u010454030/article/details/79872003

  • 相关阅读:
    Split Temporary Variable
    Introduce Explaining Variable
    Replace Temp with Query
    Extract Method
    自测代码的价值
    代码的坏味道
    Divergent Change & Shotgun Surgery
    Large Class
    Long Method
    Duplicated Code
  • 原文地址:https://www.cnblogs.com/GO-NO-1/p/13359068.html
Copyright © 2020-2023  润新知