Jianghan 4 年之前
父节点
当前提交
f92b5ab860
共有 7 个文件被更改,包括 350 次插入37 次删除
  1. 40 0
      mapping/biddingmapping.json
  2. 1 1
      mapping/entmapping.json
  3. 263 0
      mapping/qyxy-ent.json
  4. 20 10
      mapping/tool.txt
  5. 14 14
      mapping/winner.json
  6. 9 9
      mapping/更换索引库索引名称.txt
  7. 3 3
      mapping/注意.txt

+ 40 - 0
mapping/biddingmapping.json

@@ -389,6 +389,46 @@ curl -XPUT http://127.0.0.1:9800/bidding_v2 -d '{
         "entidlist": {
           "index": "not_analyzed",
           "type": "string"
+        },
+        "funds": {
+          "analyzer": "my_ngram",
+          "type": "string"
+        },
+        "review_experts": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+        "bidmethod": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+        "bidendtime": {
+          "type": "long"
+        },
+        "bidopenaddress": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+        "docamount": {
+          "type": "double"
+        },
+        "agencyrate": {
+          "type": "double"
+        },
+        "agencyfee": {
+          "type": "double"
+        },
+        "getdocmethod": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+        "bidway": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+        "china_bidding": {
+          "index": "not_analyzed",
+          "type": "string"
         }
       }
     }

+ 1 - 1
mapping/entmapping.json

@@ -1,4 +1,4 @@
- curl -XPUT http://127.0.0.1:9800/qyxy_v2 -d '{
+ curl -XPUT http://127.0.0.1:9800/qyxy_v1 -d '{
   "settings": {
     "index": {
 	  "analysis": {

+ 263 - 0
mapping/qyxy-ent.json

@@ -0,0 +1,263 @@
+curl -XPUT http://127.0.0.1:9800/qyxy_v2 -d '{
+    "settings": {
+      "index": {
+        "analysis": {
+          "analyzer": {
+              "my_ngram": {
+                  "filter": [
+                      "lowercase"
+                  ],
+                  "tokenizer": "my_ngram"
+              },
+              "douhao": {
+                "type": "pattern",
+                "pattern": ","
+              },
+              "p_ngram": {
+                "filter": [
+                  "lowercase"
+                ],
+                "tokenizer": "p_ngram"
+              }
+          },
+          "tokenizer": {
+              "my_ngram": {
+                  "type": "nGram",
+                  "min_gram": "2",
+                  "max_gram": "2"
+              },
+              "p_ngram": {
+                "token_chars": [
+                  "letter",
+                  "digit",
+                  "symbol"
+                ],
+                "min_gram": "2",
+                "type": "nGram",
+                "max_gram": "2"
+              }
+          }
+        },
+        "number_of_shards": "8",
+        "number_of_replicas": "0"
+      }
+    },
+    "mappings": {
+      "qyxy": {
+        "transform": {
+          "lang": "groovy",
+          "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]"
+        },
+        "_all": {
+          "enabled": false
+        },
+        "_id": {
+          "path": "_id"
+        },
+        "properties": {
+          "name": {
+            "analyzer": "my_ngram",
+            "type": "string",
+            "fields": {
+              "ent_name": {
+                "index": "not_analyzed",
+                "type": "string"
+              },
+              "ent_ikname": {
+                "analyzer": "ik_smart",
+                "type": "string"
+              }
+            }
+          },
+          "company_name": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "history_name": {
+            "analyzer": "my_ngram",
+            "type": "string",
+            "fields": {
+                "hname": {
+                  "index": "not_analyzed",
+                  "type": "string"
+                }
+            }
+          },
+          "company_code": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "credit_no": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "org_code": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "tax_code": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "area_code": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "company_area": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "company_city": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "company_district": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "company_type_old": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "company_type": {
+            "type": "string"
+          },
+          "company_type_int": {
+              "type": "integer"
+          },
+          "legal_person": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "legal_person_certno": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "establish_date": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "lastupdatetime": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "capital": {
+            "type": "double"
+          },
+          "currency": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "operation_startdate": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "operation_enddate": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "authority": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "issue_date": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "company_status": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "company_address": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "business_scope": {
+            "type": "string"
+          },
+          "cancel_date": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "revoke_date": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "company_phone": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "company_email": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "stock_name": {
+            "analyzer": "douhao",
+            "type": "string"
+          },
+          "partners": {
+            "properties": {
+              "identify_no": {
+                "index": "not_analyzed",
+                "type": "string"
+              },
+              "stock_type": {
+                "index": "not_analyzed",
+                "type": "string"
+              },
+              "stock_name": {
+                "index": "not_analyzed",
+                "type": "string"
+              },
+              "identify_type": {
+                "index": "not_analyzed",
+                "type": "string"
+              },
+              "stock_capital": {
+                  "type": "double"
+              },
+              "stock_realcapital": {
+                  "type": "double"
+              }
+            }
+          },
+          "updatetime": {
+            "type": "long"
+          },
+          "bid_projectname": {
+            "analyzer": "p_ngram",
+            "type": "string"
+          },
+          "bid_purchasing": {
+            "analyzer": "p_ngram",
+            "type": "string"
+          },
+          "search_type": {
+            "index": "not_analyzed",
+            "type": "string"
+          },
+          "employee_name": {
+            "analyzer": "douhao",
+            "type": "string"
+          },
+          "bid_area": {
+            "analyzer": "p_ngram",
+            "type": "string"
+          },
+          "bid_unittype": {
+            "analyzer": "douhao",
+            "type": "string"
+          },
+          "bid_contracttype": {
+            "analyzer": "douhao",
+            "type": "string"
+          },
+          "company_shortname": {
+            "index": "not_analyzed",
+            "type": "string"
+          }
+        }
+      }
+    }
+  }'
+  

+ 20 - 10
mapping/tool.txt

@@ -1,10 +1,10 @@
 // 新增某字段mapping
-curl -XPUT http://192.168.3.128:9800/bidding_v5/bidding/_mapping -d '
+curl -XPUT http://127.0.0.1:9800/qyxy_v2/qyxy/_mapping -d '
 {
   "properties": {
-    "entidlist": {
-    "index": "not_analyzed",
-    "type": "string"
+    "company_shortname": {
+      "index": "not_analyzed",
+      "type": "string"
     }
   }
 }'
@@ -23,14 +23,14 @@ curl -XPUT http://127.0.0.1:9800/_cluster/settings -d'{
   }
 }'
 //开启节点平衡
-curl -XPUT http://192.168.3.11:9800/_cluster/settings -d'{
+curl -XPUT http://192.168.3.206:9800/_cluster/settings -d'{
   "transient" : {
     "cluster.routing.allocation.enable" : "all"
   }
 }'
 
 //关闭节点平衡
-curl -XPUT http://192.168.3.11:9800/_cluster/settings -d'{
+curl -XPUT http://192.168.3.206:9800/_cluster/settings -d'{
   "transient" : {
     "cluster.routing.allocation.enable" : "none"
   }
@@ -40,8 +40,8 @@ curl -XPOST 'http://192.168.3.128:9800/_cluster/reroute' -d '{
     "commands" : [ {
         "move" : 
             {
-              "index" : "qyxy_v1", "shard" : 2, 
-              "from_node" : "GqK0c02DTi264kKPYmw3pA", "to_node" : "m0YXNuy9RGqTo5JWdD5BdA"
+              "index" : "bidding_v1", "shard" : 3, 
+              "from_node" : "node-2", "to_node" : "node-3"
             }
         }
     ]
@@ -54,7 +54,17 @@ curl -XPUT 'http://127.0.0.1:9800/projectset_v1/_settings' -d '{
 "index.routing.allocation.total_shards_per_node":2
 }'
 
-
+// 分片异常 unsigned
+curl -XPOST '192.168.3.128:9800/_cluster/reroute' -d '{
+    "commands": [{
+        "allocate": {
+            "index": "qyxy_v1",
+            "shard": 0,
+            "node": "node-1",
+            "allow_primary": 1
+        }
+    }]
+}'
 
 //新增某字段mapping
 curl -XPUT http://192.168.3.128:9800/projectset_v5/projectset/_mapping -d '
@@ -79,7 +89,7 @@ curl -XPUT http://127.0.0.1:9800/qyxy_v1/qyxy/_mapping -d '
 }'
 
 // 恢复mapping文件
-curl -XPOST "http://192.168.3.11:9800/bidding/bidding/_mapping?pretty" -d '
+curl -XPOST "http://192.168.3.128:9800/bidding/bidding/_mapping?pretty" -d '
 {
   "bidding": {
     "transform": {

+ 14 - 14
mapping/winner.json

@@ -1,4 +1,4 @@
-curl -XPUT http://127.0.0.1:9800/winner_v3 -d '{
+curl -XPUT http://192.168.3.11:9800/winner_v1 -d '{
   "settings": {
     "index": {
       "analysis": {
@@ -15,7 +15,7 @@ curl -XPUT http://127.0.0.1:9800/winner_v3 -d '{
           }
         }
       },
-      "number_of_shards": "8",
+      "number_of_shards": "2",
       "number_of_replicas": "0"
     }
   },
@@ -32,32 +32,32 @@ curl -XPUT http://127.0.0.1:9800/winner_v3 -d '{
         "enabled": false
       },
       "properties": {
-	    "winnersign": {
+        "winnersign": {
           "type": "long"
         },
-		"l_createtime": {
+        "l_createtime": {
           "type": "long"
         },
-		"name":{
-		  "analyzer": "my_ngram",
-		  "type": "string"
-		},
-		"id": {
+        "name": {
+          "analyzer": "my_ngram",
+          "type": "string"
+        },
+        "id": {
           "index": "not_analyzed",
           "type": "string"
         },
-		"pici": {
-           "type": "long"
+        "pici": {
+          "type": "long"
         },
-		"province": {
+        "province": {
           "index": "not_analyzed",
           "type": "string"
         },
-		"city": {
+        "city": {
           "index": "not_analyzed",
           "type": "string"
         },
-		"winner_name": {
+        "winner_name": {
           "index": "not_analyzed",
           "type": "string"
         }

+ 9 - 9
mapping/更换索引库索引名称.txt

@@ -31,11 +31,11 @@ curl -XPOST http://127.0.0.1:9800/_aliases -d '
     "actions": [
         { "remove": {
             "alias": "winner",
-            "index": "winner_v2"
+            "index": "winner_v3"
         }},
         { "add": {
             "alias": "winner",
-            "index": "winner_v3"
+            "index": "winner_v1"
         }}
     ]
 }'
@@ -54,16 +54,16 @@ curl -XPOST http://127.0.0.1:9800/_aliases -d '
     ]
 }'
 
-curl -XPOST http://127.0.0.1:9800/_aliases -d '
+curl -XPOST http://192.168.3.206:9800/_aliases -d '
 {
     "actions": [
-        { "remove": {
-            "alias": "qyxy",
-            "index": "qyxy_v1"
-        }},
         { "add": {
-            "alias": "qyxy",
-            "index": "qyxy_v2"
+            "alias": "bidding",
+            "index": "bidding_v1"
+        }},
+        { "remove": {
+            "alias": "bidding",
+            "index": "bidding_v5"
         }}
     ]
 }'

+ 3 - 3
mapping/注意.txt

@@ -1,4 +1,4 @@
-bidding索引:
-	1、biddingindex和biddingall生索引的json文件不一样(filetext,purchasing,purchasinglist)
-	2、filetext,purchasing,purchasinglist生索引目前在定时任务中,后续改入biddingindex
+bidding绱㈠紩锛�
+	1銆乥iddingindex鍜宐iddingall鐢熺储寮曠殑json鏂囦欢涓嶄竴鏍�(filetext,purchasing,purchasinglist)
+	2銆乫iletext,purchasing,purchasinglist鐢熺储寮曠洰鍓嶅湪瀹氭椂浠诲姟涓�紝鍚庣画鏀瑰叆biddingindex