Elasticsearch 增加、刪除索引
阿新 • • 發佈:2021-01-19
建立索引
建立索引index時對映mapping
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/blog1