Bläddra i källkod

添加 新字段 es 语句

wcc 1 månad sedan
förälder
incheckning
b20742153d
2 ändrade filer med 71 tillägg och 1 borttagningar
  1. 1 1
      mapping/projectset2.txt
  2. 70 0
      mapping/添加字段.txt

+ 1 - 1
mapping/projectset2.txt

@@ -1,4 +1,4 @@
-curl -H 'Content-Type: application/json'  -XPUT http://172.20.45.129:9206/projectset_v1 -d '{
+curl -H 'Content-Type: application/json'  -XPUT http://172.20.45.129:9206/projectset_v2 -d '{
   "settings": {
     "index": {
       "analysis": {

+ 70 - 0
mapping/添加字段.txt

@@ -0,0 +1,70 @@
+1、添加字段钱,先打开 节点平衡
+
+```
+curl -H 'Content-Type: application/json' -u jybid:Top2023_JEB01i@31 -XPUT http://127.0.0.1:19908/_cluster/settings -d'{
+  "transient" : {
+    "cluster.routing.allocation.enable" : "all"
+  }
+}'
+```
+2、添加字段
+
+
+```
+curl -u jybid:Top2023_JEB01i@31  -XPUT "http://127.0.0.1:19908/bidding/_mapping" -H 'Content-Type: application/json' -d'
+{
+  "properties": {
+      "basicClass": {
+          "type": "keyword"
+      }
+  }
+}
+'
+```
+
+```
+curl -u jybid:Top2023_JEB01i@31  -XPUT "http://127.0.0.1:19908/projectset/_mapping" -H 'Content-Type: application/json' -d'
+{
+  "properties": {
+    "projectperiod":       { "type": "keyword" },
+    "basicClass":          { "type": "keyword" },
+    "est_purchase_time":   { "type": "long" },
+    "signaturedate":       { "type": "long" },
+    "expiredate":          { "type": "long" },
+    "docendtime":          { "type": "long" },
+    "docstarttime":        { "type": "long" },
+    "bidstarttime":        { "type": "long" }
+  }
+}'
+```
+
+```
+curl -u jybid:Top2023_JEB01i@31  -XPUT "http://127.0.0.1:19908/projectset/_mapping" -H 'Content-Type: application/json' -d'
+{
+  "properties": {
+    "list": {
+      "properties": {
+        "projectperiod":       { "type": "keyword" },
+        "basicClass":          { "type": "keyword" },
+        "est_purchase_time":   { "type": "long" },
+        "signaturedate":       { "type": "long" },
+        "expiredate":          { "type": "long" },
+        "docendtime":          { "type": "long" },
+        "docstarttime":        { "type": "long" },
+        "bidstarttime":        { "type": "long" }
+      }
+    }
+  }
+}'
+
+```
+
+3、关闭节点平衡
+
+```
+curl -H 'Content-Type: application/json' -u jybid:Top2023_JEB01i@31 -XPUT http://127.0.0.1:19908/_cluster/settings -d'{
+  "transient" : {
+    "cluster.routing.allocation.enable" : "none"
+  }
+}'
+```