ES--Kibana相關操作創建索引和Mapping


創建索引

kibana 使用如下命令進行創建索引內容。

PUT test_index/

創建別名

POST _aliases {
    "actions": [{
        "add": {
            "index": "test_index",
            "alias": "test_index_name"
        }
    }, {
        "add": {
            "index": "idx_internet_bar_entity",
            "alias": "test_index_name",
            "filter": {
                "term": {
                    "team": "test_one"
                }
            }
        }
    }]
}

創建Mapping

POST test_index / test_type / _mapping {
    "test_type": {
        "dynamic": false,
        "_all": {
            "enabled": false
        },
        "properties": {
            "wbbh": {
                "type": "keyword"
            },
            "jyxkzbh": {
                "type": "keyword"
            },
            "wbmc": {
                "type": "text",
                "analyzer": "smartcn",
                "fields": {
                    "raw": {
                        "type": "keyword"
                    },
                    "standard": {
                        "type": "text",
                        "analyzer": "standard"
                    }
                }
            },
            "zbx": {
                "type": "keyword"
            },
            "zby": {
                "type": "keyword"
            },
            "zby_zbx": {
                "type": "keyword"
            },
            "lksj": {
                "type": "keyword"
            },
            "wbdz": {
                "type": "text",
                "analyzer": "smartcn",
                "fields": {
                    "raw": {
                        "type": "keyword"
                    },
                    "standard": {
                        "type": "text",
                        "analyzer": "standard"
                    }
                }
            },
            "cjsj": {
                "type": "date"
            },
            "rksj": {
                "type": "date"
            },
            "gxdwmc": {
                "type": "text",
                "analyzer": "smartcn",
                "fields": {
                    "raw": {
                        "type": "keyword"
                    },
                    "standard": {
                        "type": "text",
                        "analyzer": "standard"
                    }
                }
            },
            "wbfzr": {
                "type": "text",
                "analyzer": "smartcn",
                "fields": {
                    "raw": {
                        "type": "keyword"
                    },
                    "standard": {
                        "type": "text",
                        "analyzer": "standard"
                    }
                }
            },
            "dt": {
                "type": "keyword"
            },
            "type": {
                "type": "keyword"
            }
        }
    }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM