[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"site-config":3,"primary-menu":6,"cat-elasticsearch":85,"catposts-elasticsearch":99,"post-detail-post-es-cluster-9db8e817":208},{"config":4,"socialLinks":5},null,[],{"metadata":7,"spec":10,"menuItems":20},{"name":8,"creationTimestamp":9},"primary","2026-09-12T06:13:55.024154Z",{"displayName":11,"menuItems":12},"主菜单",[13,14,15,16,17,18,19],"88c3f10b-321c-4092-86a8-70db00251b74","menu-item-izrtmxer","c4c814d1-0c2c-456b-8c96-4864965fee94","menu-item-column","menu-item-tools","menu-item-zsxq","menu-item-ocrxlczu",[21,30,40,49,58,67,76],{"displayName":22,"metadata":23,"spec":25,"status":28,"children":29},"首页",{"name":13,"creationTimestamp":24},"2026-09-12T06:13:54.422830Z",{"displayName":22,"href":26,"priority":27,"menuName":8},"\u002F",0,{"displayName":22,"href":26},[],{"displayName":31,"metadata":32,"spec":34,"status":38,"children":39},"Java面试八股",{"name":14,"creationTimestamp":33},"2026-09-13T09:42:02.854891Z",{"displayName":31,"href":35,"target":36,"priority":37,"menuName":8},"\u002Fjava-interview","_self",1,{"displayName":31,"href":35},[],{"displayName":41,"metadata":42,"spec":44,"status":47,"children":48},"文章",{"name":15,"creationTimestamp":43},"2026-09-12T06:13:54.457307Z",{"displayName":41,"href":45,"priority":46,"menuName":8},"\u002Farchives",2,{"displayName":41,"href":45},[],{"displayName":50,"metadata":51,"spec":53,"status":56,"children":57},"项目实战",{"name":16,"creationTimestamp":52},"2026-09-14T00:35:08.138170Z",{"displayName":50,"href":54,"target":36,"priority":55,"menuName":8},"\u002Fcolumn",3,{"displayName":50,"href":54},[],{"displayName":59,"metadata":60,"spec":62,"status":65,"children":66},"在线工具",{"name":17,"creationTimestamp":61},"2026-09-14T00:35:08.171474Z",{"displayName":59,"href":63,"target":36,"priority":64,"menuName":8},"\u002Ftools",4,{"displayName":59,"href":63},[],{"displayName":68,"metadata":69,"spec":71,"status":74,"children":75},"知识星球",{"name":18,"creationTimestamp":70},"2026-09-14T00:35:08.199145Z",{"displayName":68,"href":72,"target":36,"priority":73,"menuName":8},"\u002Fzsxq",5,{"displayName":68,"href":72},[],{"displayName":77,"metadata":78,"spec":80,"status":83,"children":84},"特价云服务器",{"name":19,"creationTimestamp":79},"2026-09-25T15:30:59.201614Z",{"displayName":77,"href":81,"target":36,"priority":82,"menuName":8},"\u002Fserver",6,{"displayName":77,"href":81},[],{"metadata":86,"spec":91,"status":97,"postCount":73},{"name":87,"creationTimestamp":88,"labels":89},"elasticsearch","2026-09-13T09:13:26.098074Z",{"haloweb.section":90},"interview",{"displayName":92,"slug":87,"cover":93,"description":94,"priority":95,"hideFromList":96,"preventParentPostCascadeQuery":96},"Elasticsearch 面试题","","Elasticsearch 面试题精讲：倒排索引、分词检索、聚合分析、集群分片与写入查询调优。",23,false,{"permalink":98,"postCount":73,"visiblePostCount":73},"\u002Fcategories\u002Felasticsearch",[100,124,145,166,187],{"metadata":101,"spec":104,"status":113,"categories":118},{"name":102,"creationTimestamp":103},"post-es-optimize-53774e14","2026-09-13T10:01:16.647823Z",{"title":105,"slug":106,"cover":93,"excerpt":107,"publishTime":109,"categories":110,"tags":111,"priority":27,"pinned":96,"deleted":96,"visible":112,"allowComment":108},"Elasticsearch 性能优化？","es-optimize",{"raw":93,"autoGenerate":108},true,"2026-09-13T10:01:16.693387Z",[87],[],"PUBLIC",{"permalink":114,"excerpt":115,"lastModifyTime":116,"phase":117},"\u002Farchives\u002Fes-optimize","一、写入优化 批量写入（Bulk API），减少网络开销。 增加 refresh_interval（如 30s），减少 refresh 频率。 关闭副本，写完再开。 用 SSD 存储。 TransLog 异步刷盘。 二、查询优化 用 filter 替代 query 做过滤。 避免深度分页，用 sea","2026-09-16T09:16:45.471802Z","PUBLISHED",[119],{"metadata":120,"spec":122,"status":123,"postCount":73},{"name":87,"creationTimestamp":88,"labels":121},{"haloweb.section":90},{"displayName":92,"slug":87,"cover":93,"description":94,"priority":95,"hideFromList":96,"preventParentPostCascadeQuery":96},{"permalink":98,"postCount":73,"visiblePostCount":73},{"metadata":125,"spec":128,"status":135,"categories":139},{"name":126,"creationTimestamp":127},"post-es-cluster-9db8e817","2026-09-13T10:01:16.451613Z",{"title":129,"slug":130,"cover":93,"excerpt":131,"publishTime":132,"categories":133,"tags":134,"priority":27,"pinned":96,"deleted":96,"visible":112,"allowComment":108},"Elasticsearch 集群架构？","es-cluster",{"raw":93,"autoGenerate":108},"2026-09-13T10:01:16.505423Z",[87],[],{"permalink":136,"excerpt":137,"lastModifyTime":138,"phase":117},"\u002Farchives\u002Fes-cluster","一、节点角色 Master：管理集群元数据，选举。 Data：存储分片数据，执行 CRUD、搜索。 Ingest：数据预处理（pipeline）。 Coordinating：路由请求，合并结果。 Machine Learning：机器学习。 Remote Cluster：跨集群搜索。 二、分片 In","2026-09-16T09:16:45.007110Z",[140],{"metadata":141,"spec":143,"status":144,"postCount":73},{"name":87,"creationTimestamp":88,"labels":142},{"haloweb.section":90},{"displayName":92,"slug":87,"cover":93,"description":94,"priority":95,"hideFromList":96,"preventParentPostCascadeQuery":96},{"permalink":98,"postCount":73,"visiblePostCount":73},{"metadata":146,"spec":149,"status":156,"categories":160},{"name":147,"creationTimestamp":148},"post-es-query-2bd1cec3","2026-09-13T10:01:16.111595Z",{"title":150,"slug":151,"cover":93,"excerpt":152,"publishTime":153,"categories":154,"tags":155,"priority":27,"pinned":96,"deleted":96,"visible":112,"allowComment":108},"Elasticsearch 常用查询类型？","es-query",{"raw":93,"autoGenerate":108},"2026-09-13T10:01:16.311844Z",[87],[],{"permalink":157,"excerpt":158,"lastModifyTime":159,"phase":117},"\u002Farchives\u002Fes-query","一、全文查询 match：对查询词分词后匹配。 match_phrase：短语匹配，词序固定。 multi_match：多字段匹配。 query_string：支持 Lucene 查询语法。 二、精确查询 term：精确匹配不分词的值。 terms：多值精确匹配。 range：范围查询。 exist","2026-09-16T09:16:44.539296Z",[161],{"metadata":162,"spec":164,"status":165,"postCount":73},{"name":87,"creationTimestamp":88,"labels":163},{"haloweb.section":90},{"displayName":92,"slug":87,"cover":93,"description":94,"priority":95,"hideFromList":96,"preventParentPostCascadeQuery":96},{"permalink":98,"postCount":73,"visiblePostCount":73},{"metadata":167,"spec":170,"status":177,"categories":181},{"name":168,"creationTimestamp":169},"post-es-inverted-index-8b7f67f9","2026-09-13T10:01:15.901010Z",{"title":171,"slug":172,"cover":93,"excerpt":173,"publishTime":174,"categories":175,"tags":176,"priority":27,"pinned":96,"deleted":96,"visible":112,"allowComment":108},"Elasticsearch 的倒排索引原理？","es-inverted-index",{"raw":93,"autoGenerate":108},"2026-09-13T10:01:15.954299Z",[87],[],{"permalink":178,"excerpt":179,"lastModifyTime":180,"phase":117},"\u002Farchives\u002Fes-inverted-index","一、定义 正排索引：文档 → 词列表。 倒排索引：词 → 文档列表。 二、构建过程 文档内容分词，得到词（term）。 建立 term → [doc1, doc2, ...] 的映射。 记录词频、位置等信息。 三、示例 文档1：Java 面试\n文档2：Java 集合\n文档3：Redis 缓存\n\n倒排","2026-09-16T09:16:44.086521Z",[182],{"metadata":183,"spec":185,"status":186,"postCount":73},{"name":87,"creationTimestamp":88,"labels":184},{"haloweb.section":90},{"displayName":92,"slug":87,"cover":93,"description":94,"priority":95,"hideFromList":96,"preventParentPostCascadeQuery":96},{"permalink":98,"postCount":73,"visiblePostCount":73},{"metadata":188,"spec":191,"status":198,"categories":202},{"name":189,"creationTimestamp":190},"post-es-architecture-a6b20c5d","2026-09-13T10:01:15.732254Z",{"title":192,"slug":193,"cover":93,"excerpt":194,"publishTime":195,"categories":196,"tags":197,"priority":27,"pinned":96,"deleted":96,"visible":112,"allowComment":108},"Elasticsearch 的核心概念？","es-architecture",{"raw":93,"autoGenerate":108},"2026-09-13T10:01:15.777887Z",[87],[],{"permalink":199,"excerpt":200,"lastModifyTime":201,"phase":117},"\u002Farchives\u002Fes-architecture","一、核心概念 Index（索引）：类似数据库的表，存储文档。 Document（文档）：JSON 格式的数据，类似行。 Field（字段）：文档中的键值对，类似列。 Shard（分片）：索引分成多个分片，分布在不同节点。 Replica（副本）：分片的副本，高可用。 二、集群 多个 Node 组成 ","2026-09-16T09:16:43.604221Z",[203],{"metadata":204,"spec":206,"status":207,"postCount":73},{"name":87,"creationTimestamp":88,"labels":205},{"haloweb.section":90},{"displayName":92,"slug":87,"cover":93,"description":94,"priority":95,"hideFromList":96,"preventParentPostCascadeQuery":96},{"permalink":98,"postCount":73,"visiblePostCount":73},{"metadata":209,"spec":210,"status":214,"categories":215,"content":221},{"name":126,"creationTimestamp":127},{"title":129,"slug":130,"cover":93,"excerpt":211,"publishTime":132,"categories":212,"tags":213,"priority":27,"pinned":96,"deleted":96,"visible":112,"allowComment":108},{"raw":93,"autoGenerate":108},[87],[],{"permalink":136,"excerpt":137,"lastModifyTime":138,"phase":117},[216],{"metadata":217,"spec":219,"status":220,"postCount":73},{"name":87,"creationTimestamp":88,"labels":218},{"haloweb.section":90},{"displayName":92,"slug":87,"cover":93,"description":94,"priority":95,"hideFromList":96,"preventParentPostCascadeQuery":96},{"permalink":98,"postCount":73,"visiblePostCount":73},{"content":222,"raw":222},"\u003Ch2>一、节点角色\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>Master\u003C\u002Fstrong>：管理集群元数据，选举。\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Data\u003C\u002Fstrong>：存储分片数据，执行 CRUD、搜索。\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Ingest\u003C\u002Fstrong>：数据预处理（pipeline）。\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Coordinating\u003C\u002Fstrong>：路由请求，合并结果。\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Machine Learning\u003C\u002Fstrong>：机器学习。\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Remote Cluster\u003C\u002Fstrong>：跨集群搜索。\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>二、分片\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>Index 创建时指定主分片数（不可改）和副本数（可改）。\u003C\u002Fli>\n\u003Cli>主分片负责写入，副本分片提供读和高可用。\u003C\u002Fli>\n\u003Cli>分片数预估：单分片不超过 50GB，单节点分片不超过 1000。\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>三、选举\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>基于 Bully 算法。\u003C\u002Fli>\n\u003Cli>master-eligible 节点参与选举。\u003C\u002Fli>\n\u003Cli>半数以上同意才选为 Master。\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>四、脑裂\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>网络分区导致两个 Master。\u003C\u002Fli>\n\u003Cli>配置 discovery.zen.minimum_master_nodes = N\u002F2 + 1 防止。\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>五、扩展\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>加节点：自动 rebalance 分片。\u003C\u002Fli>\n\u003Cli>扩副本：API 修改副本数。\u003C\u002Fli>\n\u003Cli>主分片数不可变，需重建索引。\u003C\u002Fli>\n\u003C\u002Ful>"]