全部文档
当前文档

暂无内容

如果没有找到您期望的内容,请尝试其他搜索词

文档中心

推荐索引模板

最近更新时间:2021-03-03 16:10:31

推荐索引模板保存在文件template.json中,内容如下:

{
    "order": 0,
    "template": "*",
    "settings": {
        "index": {
            "max_result_window": "65536",
            "routing": {
                "allocation": {
                    "require": {
                        "box_type": "hot"
                    }
                }
            },
            "search": {
                "slowlog": {
                    "threshold": {
                        "query": {
                            "warn": "10s",
                            "info": "5s"
                        }
                    }
                }
            },
            "refresh_interval": "60s",
            "unassigned": {
                "node_left": {
                    "delayed_timeout": "5m"
                }
            },
            "indexing": {
                "slowlog": {
                    "threshold": {
                        "index": {
                            "warn": "10s",
                            "info": "5s"
                        }
                    }
                }
            },
            "number_of_shards": "5",
            "translog": {
                "flush_threshold_size": "5g",
                "sync_interval": "60s",
                "durability": "async"
            },
            "number_of_replicas": "1"
        }
    },
    "mappings": {
        "_default_": {
            "dynamic_templates": [{
                    "all_tpl": {
                        "mapping": {
                            "ignore_above": 1024,
                            "index": "not_analyzed",
                            "type": "{dynamic_type}",
                            "doc_values": true
                        },
                        "match": "*"
                    }
                },
                {
                    "strings": {
                        "match_mapping_type": "string",
                        "mapping": {
                            "type": "keyword"
                        }
                    }
                }
            ],
            "_all": {
                "enabled": false
            }
        }
    },
    "aliases": {}
}

模板生效命令:

curl -H "Content-Type: application/json" -XPUT
"es_ip:es_port/_template/.default" -d @template.json
文档导读
纯净模式常规模式

纯净模式

点击可全屏预览文档内容
文档反馈