1. # 添加字段 并初始化值
    2. POST 索引名/_update_by_query
    3. {
    4. "script": {
    5. "source": "ctx._source['isWebShow'] = \"1\""
    6. }
    7. }
    8. #查询索引下所有数据
    9. GET msg_dms_information_annex/_search
    10. {
    11. "query": {
    12. "match_all": {}
    13. }
    14. }
    15. #删除索引下所有数据
    16. POST msg_dms_information_annex/_delete_by_query
    17. {
    18. "query": {
    19. "match_all": {}
    20. }
    21. }
    22. #删除索引
    23. DELETE msg_dms_information_annex
    24. #修改字段mapping映射
    25. POST /msg_dms_information_info/_mapping
    26. {
    27. "properties": {
    28. "isRecommend": {
    29. "type" : "text",
    30. "fields" : {
    31. "keyword" : {
    32. "type" : "keyword",
    33. "ignore_above" : 256
    34. }
    35. },
    36. "fielddata": true
    37. }
    38. }
    39. }