ElasticSearch 7索引相对于ElasticSearch 5太大

如何解决ElasticSearch 7索引相对于ElasticSearch 5太大

我们正在从ElasticSearch 5.6迁移到7.9。在5.6上,我们有2个索引,一个包含3.4k文档,占111.2 MB,另一个具有81.6k文档,占845.6 MB。在7.9上,我们具有相同的2个索引(通过相同的过程写入)并具有相似的映射,但是它分别使用14.3 GB和15.6 GB。

我不知道是什么使这些指数在7.9与5.6之间如此之大。

如果您感到好奇,请参阅以下映射(为了保护我们的数据,我混淆了许多字段的名称): ES 5.6

{
  "blah-state-37c088aea98d4b60ad58fb04abe55aa7": {
    "mappings": {
      "blahblah": {
        "properties": {
          "blahStatus": {
            "type": "text","fields": {
              "keyword": {
                "type": "keyword","ignore_above": 256
              }
            }
          },"blah": {
            "type": "integer"
          },"blahblah": {
            "type": "long"
          },"blahblahblah": {
            "type": "text"
          },"blahblahblahblah": {
            "type": "integer"
          },"blahblahblahzzz": {
            "type": "text","fields": {
              "keyword": {
                "type": "keyword"
              }
            },"analyzer": "ngram_suggest"
          },"blahblahblahhh": {
            "type": "text","index": false,"store": true
          },"blahblahblaaaa": {
            "type": "keyword"
          },"created": {
            "type": "text"
          },"ended": {
            "type": "text"
          },"blaaaaah": {
            "type": "boolean"
          },"blaahaah": {
            "type": "integer"
          },"bloop": {
            "type": "boolean"
          },"bloopibob": {
            "type": "integer"
          },"blabiba": {
            "type": "keyword"
          },"blah": {
            "type": "long"
          },"bleeeep": {
            "type": "boolean"
          },"blahhh": {
            "type": "boolean"
          },"blahah": {
            "type": "text"
          },"hidden": {
            "type": "boolean"
          },"blah1": {
            "type": "boolean"
          },"blah2": {
            "type": "boolean"
          },"blah3": {
            "type": "boolean"
          },"blah4": {
            "type": "boolean"
          },"blah5": {
            "type": "boolean"
          },"blah6": {
            "type": "boolean"
          },"blah7": {
            "type": "boolean"
          },"blah8": {
            "type": "boolean"
          },"blah9": {
            "type": "boolean"
          },"blah10": {
            "type": "boolean"
          },"blah11": {
            "type": "boolean"
          },"blah12": {
            "type": "boolean"
          },"blah13": {
            "type": "boolean"
          },"isInvalid": {
            "type": "boolean"
          },"blah14": {
            "type": "boolean"
          },"isNew": {
            "type": "boolean"
          },"blah15": {
            "type": "boolean"
          },"keywords": {
            "type": "text","analyzer": "normalized"
          },"languages": {
            "type": "keyword"
          },"blah16": {
            "type": "integer"
          },"blah17": {
            "type": "integer"
          },"blah18": {
            "type": "keyword"
          },"maxWait": {
            "type": "integer"
          },"minBuyIn": {
            "type": "float"
          },"nickname": {
            "type": "text","fields": {
              "raw": {
                "type": "keyword"
              }
            },"nicknamePartial": {
            "type": "text","analyzer": "ngram_partial"
          },"nicknameSuggest": {
            "type": "text","blah19": {
            "type": "text"
          },"blah20": {
            "type": "boolean"
          },"DocumentID": {
            "type": "keyword"
          },"pledgedAmt": {
            "type": "float"
          },"preferredLanguage": {
            "type": "text"
          },"blah21": {
            "type": "integer"
          },"blah22": {
            "type": "integer"
          },"rating": {
            "type": "integer"
          },"region": {
            "type": "keyword"
          },"requestedAmt": {
            "type": "float"
          },"showInFreeAreas": {
            "type": "boolean"
          },"blah23": {
            "type": "boolean"
          },"blah24": {
            "type": "text"
          },"blah25": {
            "type": "scaled_float","scaling_factor": 100000
          },"sortScore": {
            "type": "long"
          },"started": {
            "type": "text"
          },"statusKey": {
            "type": "text"
          },"blah26": {
            "type": "long"
          },"blah27": {
            "type": "text","tagName": {
            "type": "text","tagNameRaw": {
            "type": "text","tagNameSuggest": {
            "type": "text","blah28": {
            "type": "boolean"
          },"traceId": {
            "type": "object","enabled": false
          },"updated": {
            "type": "long"
          },"blah29": {
            "type": "boolean"
          }
        }
      }
    }
  }
}

和7.9

{
  "blah-state-37c088aea98d4b60ad58fb04abe55aa7" : {
    "mappings" : {
      "properties" : {
        "accountStatus" : {
          "type" : "keyword"
        },"boost" : {
          "type" : "integer"
        },"age" : {
          "type" : "integer"
        },"bleeeeeep" : {
          "type" : "keyword"
        },"bleeeep" : {
          "type" : "text","fields" : {
            "keyword" : {
              "type" : "keyword"
            }
          },"analyzer" : "ngram_suggest"
        },"bleeep" : {
          "type" : "keyword"
        },"bleep" : {
          "type" : "keyword"
        },"blah0" : {
          "type" : "boolean"
        },"blah1" : {
          "type" : "boolean"
        },"blah2" : {
          "type" : "text"
        },"hidden" : {
          "type" : "boolean"
        },"blah3" : {
          "type" : "boolean"
        },"blah4" : {
          "type" : "boolean"
        },"blah5" : {
          "type" : "boolean"
        },"blah6" : {
          "type" : "boolean"
        },"blah7" : {
          "type" : "boolean"
        },"blah8" : {
          "type" : "boolean"
        },"blah9" : {
          "type" : "boolean"
        },"blah10" : {
          "type" : "boolean"
        },"blah11" : {
          "type" : "boolean"
        },"blah12" : {
          "type" : "boolean"
        },"blah13" : {
          "type" : "boolean"
        },"blah14" : {
          "type" : "boolean"
        },"blah15" : {
          "type" : "boolean"
        },"blah16" : {
          "type" : "boolean"
        },"isNew" : {
          "type" : "boolean"
        },"blah17" : {
          "type" : "boolean"
        },"keywords" : {
          "type" : "text","analyzer" : "normalized"
        },"languages" : {
          "type" : "keyword"
        },"blah18" : {
          "type" : "integer"
        },"blah19" : {
          "type" : "integer"
        },"nickname" : {
          "type" : "text","fields" : {
            "raw" : {
              "type" : "keyword"
            }
          },"nicknamePartial" : {
          "type" : "text","analyzer" : "ngram_partial"
        },"nicknameSuggest" : {
          "type" : "text","blah20" : {
          "type" : "boolean"
        },"blah21" : {
          "type" : "boolean"
        },"DocumentId" : {
          "type" : "keyword"
        },"preferredLanguage" : {
          "type" : "keyword"
        },"rating" : {
          "type" : "integer"
        },"region" : {
          "type" : "keyword"
        },"blah22" : {
          "type" : "boolean"
        },"blah23" : {
          "type" : "boolean"
        },"blah24" : {
          "type" : "scaled_float","scaling_factor" : 100000.0
        },"sortScore" : {
          "type" : "integer"
        },"blah25" : {
          "type" : "keyword"
        },"tagName" : {
          "type" : "text","tagNameRaw" : {
          "type" : "text","tagNameSuggest" : {
          "type" : "text","blah26" : {
          "type" : "boolean"
        },"traceId" : {
          "type" : "object","enabled" : false
        },"updated" : {
          "type" : "long"
        },"blah27" : {
          "type" : "boolean"
        }
      } 
    }
  }
}

编辑:这是设置: 5.6:

"settings": {
      "index": {
        "analysis": {
          "filter": {
            "english_stemmer": {
              "type": "stemmer","language": "english"
            }
          },"analyzer": {
            "ngram_partial": {
              "filter": [
                "standard","asciifolding","lowercase"
              ],"tokenizer": "ngram"
            },"ngram_suggest": {
              "filter": [
                "standard","tokenizer": "edge_ngram"
            },"normalized": {
              "filter": [
                "standard","lowercase","english_stemmer"
              ],"type": "custom","tokenizer": "standard"
            }
          },"tokenizer": {
            "edge_ngram": {
              "token_chars": [
                "letter","digit","punctuation"
              ],"min_gram": "1","type": "edge_ngram","max_gram": "20"
            },"ngram": {
              "token_chars": [
                "letter","min_gram": "2","type": "ngram","max_gram": "20"
            }
          }
        },"number_of_shards": "12"
      }
    }

和7.9:

"settings" : {
      "index" : {
        "analysis" : {
          "filter" : {
            "english_stemmer" : {
              "type" : "stemmer","language" : "english"
            }
          },"analyzer" : {
            "ngram_partial" : {
              "filter" : [
                "asciifolding","tokenizer" : "ngram"
            },"ngram_suggest" : {
              "filter" : [
                "asciifolding","tokenizer" : "edge_ngram"
            },"normalized" : {
              "filter" : [
                "asciifolding","type" : "custom","tokenizer" : "standard"
            }
          },"tokenizer" : {
            "edge_ngram" : {
              "token_chars" : [
                "letter","min_gram" : "1","type" : "edge_ngram","max_gram" : "20"
            },"ngram" : {
              "token_chars" : [
                "letter","min_gram" : "3","type" : "ngram","max_gram" : "3"
            }
          }
        },"number_of_shards" : "12"
      }
    }

_cat / shards的结果 5.6:

redacted-state-37c088aea98d4b60ad58fb04abe55aa7 1     p      STARTED  960   8mb 000.00.000.84 host5
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 1     r      STARTED  960   8mb 000.00.000.89 host10
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 1     r      STARTED  960 8.1mb 000.00.000.80 host1
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 1     r      STARTED  960 7.7mb 000.00.000.86 host7
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 2     r      STARTED  978 9.2mb 000.00.000.90 host11
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 2     r      STARTED  978 8.9mb 000.00.000.81 host2
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 2     p      STARTED  978 8.7mb 000.00.000.87 host8
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 2     r      STARTED  978 8.6mb 000.00.000.83 host4
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 0     p      STARTED  990 8.1mb 000.00.000.85 host6
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 0     r      STARTED  990 7.6mb 000.00.000.91 host12
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 0     r      STARTED  990 8.5mb 000.00.000.88 host9
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 0     r      STARTED  990 7.9mb 000.00.000.82 host3

和7.9:

redacted-state-37c088aea98d4b60ad58fb04abe55aa7 8     p      STARTED  262 673.4mb 000.00.000.126 host12
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 8     r      STARTED  286 667.8mb 000.00.000.124 host10
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 9     p      STARTED  278 754.9mb 000.00.000.124 host10
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 9     r      STARTED  196 729.7mb 000.00.000.123 host9
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 7     p      STARTED  247 654.2mb 000.00.000.119 host5
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 7     r      STARTED  262 645.1mb 000.00.000.126 host12
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 4     p      STARTED  225 719.8mb 000.00.000.121 host7
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 4     r      STARTED  282 660.9mb 000.00.000.122 host8
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 6     p      STARTED  274 715.6mb 000.00.000.125 host11
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 6     r      STARTED  334 706.3mb 000.00.000.119 host5
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 11    r      STARTED  194 691.6mb 000.00.000.120 host6
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 11    p      STARTED  255 713.1mb 000.00.000.115 host1
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 3     p      STARTED  212 716.6mb 000.00.000.117 host3
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 3     r      STARTED  292 709.3mb 000.00.000.121 host7
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 1     p      STARTED  249 749.5mb 000.00.000.118 host4
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 1     r      STARTED  289 695.5mb 000.00.000.116 host2
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 5     p      STARTED  243 701.4mb 000.00.000.122 host8
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 5     r      STARTED  204 680.9mb 000.00.000.125 host11
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 2     p      STARTED  246 685.8mb 000.00.000.116 host2
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 2     r      STARTED  305 676.7mb 000.00.000.117 host3
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 10    p      STARTED  235 701.2mb 000.00.000.123 host9
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 10    r      STARTED  276 690.5mb 000.00.000.115 host1
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 0     p      STARTED  245 674.7mb 000.00.000.120 host6
redacted-state-37c088aea98d4b60ad58fb04abe55aa7 0     r      STARTED  301 623.5mb 000.00.000.118 host4

解决方法

经过大量实验,我们确定原因是soft deletes。不幸的是,禁用软删除已被弃用,因此这对我们将来将是一个问题。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 <select id="xxx"> SELECT di.id, di.name, di.work_type, di.updated... <where> <if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 <property name="dynamic.classpath" value="tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams['font.sans-serif'] = ['SimHei'] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -> systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping("/hires") public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate<String
使用vite构建项目报错 C:\Users\ychen\work>npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-