Elasticsearch之增加和删除索引

增加索引

利用postMan工具发送restfulAPI添加索引库 请求方式为put代表添加

创建索引index时映射mapping

请求URL:

使用put发送http://localhost:9200/blog1

{
    "mappings": {
        "article": {
            "properties": {
                    "id": {
                    "type": "long",
                    "store": true,
                    "index":"not_analyzed"
                    },
                    "title": {
                    "type": "text",
                    "store": true,
                    "index":"analyzed",
                    "analyzer":"standard"
                    },
                    "content": {
                    "type": "text",
                    "store": true,
                    "index":"analyzed",
                    "analyzer":"standard"
                    }
            }
        }
    }
}

  

效果:

创建索引index后映射mapping

先使用 put 请求发送 http://localhost:9200/blog2

然后使用 post 请求发送http://localhost:9200/blog2/hello/_mapping

删除索引

使用DELET请求发送 http://localhost:9200/blo

 

 

 

猜你喜欢

转载自www.cnblogs.com/wishsaber/p/12367562.html
今日推荐