添加字段.txt 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. 1、添加字段钱,先打开 节点平衡
  2. ```
  3. curl -H 'Content-Type: application/json' -u jybid:Top2023_JEB01i@31 -XPUT http://127.0.0.1:19908/_cluster/settings -d'{
  4. "transient" : {
  5. "cluster.routing.allocation.enable" : "all"
  6. }
  7. }'
  8. ```
  9. 2、添加字段
  10. ```
  11. curl -u jybid:Top2023_JEB01i@31 -XPUT "http://127.0.0.1:19908/bidding/_mapping" -H 'Content-Type: application/json' -d'
  12. {
  13. "properties": {
  14. "basicClass": {
  15. "type": "keyword"
  16. }
  17. }
  18. }
  19. '
  20. ```
  21. ```
  22. curl -u jybid:Top2023_JEB01i@31 -XPUT "http://127.0.0.1:19908/projectset/_mapping" -H 'Content-Type: application/json' -d'
  23. {
  24. "properties": {
  25. "projectperiod": { "type": "keyword" },
  26. "basicClass": { "type": "keyword" },
  27. "est_purchase_time": { "type": "long" },
  28. "signaturedate": { "type": "long" },
  29. "expiredate": { "type": "long" },
  30. "docendtime": { "type": "long" },
  31. "docstarttime": { "type": "long" },
  32. "bidstarttime": { "type": "long" }
  33. }
  34. }'
  35. ```
  36. ```
  37. curl -u jybid:Top2023_JEB01i@31 -XPUT "http://127.0.0.1:19908/projectset/_mapping" -H 'Content-Type: application/json' -d'
  38. {
  39. "properties": {
  40. "list": {
  41. "properties": {
  42. "projectperiod": { "type": "keyword" },
  43. "basicClass": { "type": "keyword" },
  44. "est_purchase_time": { "type": "long" },
  45. "signaturedate": { "type": "long" },
  46. "expiredate": { "type": "long" },
  47. "docendtime": { "type": "long" },
  48. "docstarttime": { "type": "long" },
  49. "bidstarttime": { "type": "long" }
  50. }
  51. }
  52. }
  53. }'
  54. ```
  55. 3、关闭节点平衡
  56. ```
  57. curl -H 'Content-Type: application/json' -u jybid:Top2023_JEB01i@31 -XPUT http://127.0.0.1:19908/_cluster/settings -d'{
  58. "transient" : {
  59. "cluster.routing.allocation.enable" : "none"
  60. }
  61. }'
  62. ```