Jianghan 1 年之前
父节点
当前提交
c1e3abcff5
共有 4 个文件被更改,包括 191 次插入20 次删除
  1. 137 0
      mapping/bidding_customer.txt
  2. 0 0
      mapping/cule_info.txt
  3. 17 2
      mapping/project-forecast2.txt
  4. 37 18
      mapping/tool.txt

+ 137 - 0
mapping/bidding_customer.txt

@@ -0,0 +1,137 @@
+curl -XPUT http://192.168.3.241:9205/bidding_customer_v1 -H 'Content-Type: application/json' -d '{
+    "settings": {
+        "index": {
+            "analysis": {
+                "analyzer": {
+                    "douhao": {
+                        "type": "pattern",
+                        "pattern": ","
+                    },
+                    "my_ngram": {
+                        "filter": [
+                            "lowercase"
+                        ],
+                        "tokenizer": "my_ngram"
+                    },
+                    "my_ngram_title": {
+                        "filter": [
+                            "lowercase"
+                        ],
+                        "tokenizer": "my_ngram_title"
+                    }
+                },
+                "tokenizer": {
+                    "my_ngram_title": {
+                        "token_chars": [
+                            "letter",
+                            "digit",
+                            "punctuation",
+                            "symbol"
+                        ],
+                        "min_gram": "1",
+                        "type": "nGram",
+                        "max_gram": "1"
+                    },
+                    "my_ngram": {
+                        "token_chars": [
+                            "letter",
+                            "digit",
+                            "punctuation",
+                            "symbol"
+                        ],
+                        "min_gram": "2",
+                        "type": "nGram",
+                        "max_gram": "2"
+                    }
+                }
+            },
+            "number_of_shards": "2",
+            "number_of_replicas": "0"
+        }
+    },
+    "mappings": {
+        "dynamic": false,
+        "properties": {
+            "id": {
+                "type": "long"
+            },
+            "ent_id": {
+                "type": "long"
+            },
+            "area": {
+                "type": "keyword"
+            },
+            "city": {
+                "type": "keyword"
+            },
+            "district": {
+                "type": "keyword"
+            },
+            "publishtime": {
+                "type": "long"
+            },
+            "toptype": {
+                "type": "keyword"
+            },
+            "subtype": {
+                "type": "keyword"
+            },
+            "buyer": {
+                "analyzer": "my_ngram_title",
+                "type": "text",
+                "fields": {
+                    "mbuyer": {
+                        "type": "keyword"
+                    }
+                }
+            },
+            "s_winner": {
+                "analyzer": "my_ngram_title",
+                "type": "text",
+                "fields": {
+                    "mwinner": {
+                        "analyzer": "douhao",
+                        "type": "text"
+                    }
+                }
+            },
+            "buyerclass": {
+                "type": "keyword"
+            },
+            "title": {
+                "analyzer": "my_ngram_title",
+                "type": "text"
+            },
+            "detail": {
+                "analyzer": "my_ngram",
+                "type": "text"
+            },
+            "matchkey": {
+                "analyzer": "douhao",
+                "type": "text"
+            },
+            "tagname": {
+                "analyzer": "douhao",
+                "type": "text"
+            },
+            "industry": {
+                "type": "integer"
+            },
+            "region": {
+                "type": "integer"
+            },
+            "winner_tag": {
+                "type": "integer"
+            },
+            "budget": {
+                "type": "double"
+            },
+            "bidamount": {
+                "type": "double"
+            },
+            "pici": {
+                "type": "long"
+            }
+        }
+    }
+}'

+ 0 - 0
mapping/cule_info.txt


+ 17 - 2
mapping/project-forecast2.txt

@@ -1,4 +1,4 @@
-curl -H 'Content-Type: application/json' -u es_all:TopJkO2E_d1x -XPUT http://127.0.0.1:19805/forecast_v2 -d '{
+curl -H 'Content-Type: application/json' -u jianyuGr:we3g8glKfe# -XPUT http://127.0.0.1:19805/forecast_v2 -d '{
   "settings": {
     "analysis": {
       "analyzer": {
@@ -43,7 +43,7 @@ curl -H 'Content-Type: application/json' -u es_all:TopJkO2E_d1x -XPUT http://127
       }
     },
     "index": {
-      "number_of_shards": "12",
+      "number_of_shards": "9",
       "number_of_replicas": "0"
     }
   },
@@ -56,6 +56,9 @@ curl -H 'Content-Type: application/json' -u es_all:TopJkO2E_d1x -XPUT http://127
         "city": {
           "type": "keyword"
         },
+        "district": {
+          "type": "keyword"
+        },
         "nature": {
           "type": "keyword"
         },
@@ -65,6 +68,9 @@ curl -H 'Content-Type: application/json' -u es_all:TopJkO2E_d1x -XPUT http://127
         "buyerclass": {
           "type": "keyword"
         },
+        "infoid": {
+          "type": "keyword"
+        },
         "title": {
           "analyzer": "my_ngram_title",
           "type": "text"
@@ -83,6 +89,15 @@ curl -H 'Content-Type: application/json' -u es_all:TopJkO2E_d1x -XPUT http://127
         "spidercode": {
           "type": "keyword"
         },
+        "budget": {
+          "type": "double"
+        },
+        "bidamount": {
+          "type": "double"
+        },
+        "sortprice": {
+          "type": "double"
+        },
         "stage": {
           "type": "keyword"
         },

+ 37 - 18
mapping/tool.txt

@@ -1,20 +1,36 @@
 // 新增某字段mapping
-curl -XPUT http://127.0.0.1:19805/projectset/_mapping -u es_all:TopJkO2E_d1x -H 'Content-Type: application/json' -d '
+curl -XPUT http://127.0.0.1:19805/forecast_v1/_mapping -u jianyuGr:we3g8glKfe# -H 'Content-Type: application/json' -d '
 {
   "properties": {
-    "bidendtime": {
-      "type": "long"
+    "budget": {
+      "type": "double"
     },
-    "list": {
-      "properties": {
-        "bidendtime": {
-          "type": "long"
-        }
-      }
+    "bidamount": {
+      "type": "double"
+    },
+    "sortprice": {
+      "type": "double"
     }
 	}
 }'
 
+curl -H 'Content-Type: application/json' -u jianyuGr:we3g8glKfe# -XPOST http://127.0.0.1:19805/_aliases -d '
+{
+  "actions": [
+      {
+        "remove": {
+          "index": "forecast_v1",
+          "alias": "forecast"
+        }
+      },
+      { "add": {
+          "alias": "forecast",
+          "index": "forecast_v2"
+        }
+      }
+  ]
+}'
+
 //新增某字段mapping,es7 版本
 curl -XPUT "http://127.0.0.1:19805/bidding_v1/_mapping"  -u es_all:TopJkO2E_d1x -H 'Content-Type: application/json' -d '
 {
@@ -50,6 +66,9 @@ curl -XPUT "http://127.0.0.1:19805/projectset/_mapping?pretty" -u es_all:TopJkO2
   }
 }'
 
+// 清库
+curl -XPOST 'http://127.0.0.1:19905/ttbid_v9/_delete_by_query' -u jybid:Top2023_JEB01i@31 -H 'Content-Type:application/json' -d '{"query": { "match_all": {} }}'
+
 // 默认查询数量
 curl -XPUT "http://127.0.0.1:19805/bidding/_settings" -u es_all:TopJkO2E_d1x -H 'Content-Type: application/json' -d '
 {
@@ -57,20 +76,20 @@ curl -XPUT "http://127.0.0.1:19805/bidding/_settings" -u es_all:TopJkO2E_d1x -H
 }'
 
 //开启节点平衡
-curl -XPUT http://127.0.0.1:19805/bidding/_settings -u es_all:TopJkO2E_d1x -H 'content-Type:application/json' -d'{
+curl -XPUT http://127.0.0.1:19805/_cluster/settings -u ianyu:KHiwdi490Sss# -H 'content-Type:application/json' -d'{
   "transient" : {
-    "cluster.routing.allocation.enable" : "all"
+    "cluster.routing.allocation.enable" : "none"
   }
 }'
 
 //关闭节点平衡
-curl -XPUT http://127.0.0.1:19805/_cluster/settings --user es_all:TopJkO2E_d1x -H 'content-Type:application/json' -d'{
+curl -XPUT http://127.0.0.1:19905/_cluster/settings -u jybid:Top2023_JEB01i@31 -H 'content-Type:application/json' -d'{
   "transient" : {
-    "cluster.routing.allocation.enable" : "none"
+    "cluster.routing.allocation.enable" : "all"
   }
 }'
 //开启节点平衡
-curl -XPUT http://127.0.0.1:19805/_cluster/settings --user es_all:TopJkO2E_d1x -H 'content-Type:application/json' -d'{
+curl -XPUT http://192.168.3.241:9205/_cluster/settings -H 'content-Type:application/json' -d'{
   "transient" : {
     "cluster.routing.allocation.enable" : "all"
   }
@@ -85,7 +104,7 @@ curl -XPUT http://192.168.3.206:9800/_cluster/settings -d'{
 //开启节点平衡,es7 环境,需要传递header参数
 curl -H 'Content-Type: application/json' -XPUT http://192.168.3.149:9200/_cluster/settings -d'{
   "transient" : {
-    "cluster.routing.allocation.enable" : "all"
+    "cluster.routing.allocation.enable" : "none"
   }
 }'
 //关闭节点平衡
@@ -96,12 +115,12 @@ curl -H 'Content-Type: application/json' -XPUT http://192.168.3.149:9200/_cluste
 }'
 
 //手动移动节点
-curl -XPOST 'http://127.0.0.1:9800/_cluster/reroute' -d '{
+curl -H 'Content-Type: application/json' -XPOST 'http://192.168.3.241:9205/_cluster/reroute' -d '{
     "commands" : [ {
         "move" : 
             {
-              "index": "qyxy_v2", "shard": 12, 
-              "from_node": "node_12", "to_node": "node_1"
+              "index": "forecast_v1", "shard": 1, 
+              "from_node": "node_1", "to_node": "node_2"
             }
         }
     ]