EalsticSearch 7.x版本創建索引

es 7.x版本和之前的版本生成索引和mapping有點不同 , 具體生成方法如下:

與以往版本少了 , index類型, 總體看來比較簡便

http://es1-kanjian/person
PUT請求, json

{
    "settings": {
            "number_of_shards": "1",
            "number_of_replicas": "0"
    },
    "mappings": {
            "properties": {
                "age": {
                    "type": "integer"
                },
                "mail": {
                    "type": "keyword",
                    "analyzer":"ik_max_word"
                },
                "hobby": {
                    "type": "text",
                    "analyzer": "ik_smart"
                }
            }
        
    }
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章