增加索引

利用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

 

 

 

 

 

 

posted on 2020-02-26 16:16  wishsaber  阅读(7009)  评论(0编辑  收藏  举报