壓縮配置: index.codec: best_compression 合並索引: curl –XPOST localhost:9200/hec_test3/_forcemerge’ 配置mapping: curl -XPUT 'http://localhost:9200/hec_test3' -d ' { "mappings": { "hec_type3": { "_source": { "enabled": false }, "_all": { "enabled": false }, "properties": { “fieldxxx": { "type": "string", “norms”: {“enabled”: false}, “store”: false, "doc_values": false, "index_options": "docs" }, …. } } } } '
注意:同時將原始數據放在DB里,ES里通過doc id去DB里獲取。_all搜索時候使用cross_fields。.tim文件較大,可以采用降低shard個數來瘦身。
總之,上述設置后可以將es的索引數據磁盤占用降低為原始數據的50%以內。