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

 

 

 

 

 

 


免責聲明!

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



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