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"
                }
            }
        
    }
}

 

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