1.创建索引

  1. PUT test_index1
  2. {
  3. "settings": {
  4. "index": {
  5. "number_of_shards": "5",
  6. "number_of_replicas": "1"
  7. }
  8. },
  9. "mappings": {
  10. "_doc": {
  11. "properties": {
  12. "name": {
  13. "type": "keyword"
  14. },
  15. "describe": {
  16. "type": "text"
  17. }
  18. }
  19. }
  20. }
  21. }

2.查看索引字段映射

  1. GET test_index1/_mapping

3.添加字段(添加后不能删除)

  1. PUT test_index1/_mapping/_doc
  2. {
  3. "properties": {
  4. "fullName": {
  5. "type": "keyword"
  6. }
  7. }
  8. }

4.删除索引

  1. DELETE test_index1