maxiaoshan před 4 roky
revize
7447a645f7

+ 3 - 0
mapping/biddingindex依赖服务.txt

@@ -0,0 +1,3 @@
+cd /opt && wget http://172.17.145.176:1182/hanlp/hanlpforgo.tgz -O hanlpforgo.tgz && tar -zxvf hanlpforgo.tgz && rm -rf hanlpforgo.tgz && cd hanlpforgo && chmod +x hanlp_run.sh && ./hanlp_run.sh 
+
+echo "59 17 * * * cd /opt/hanlpforgo && ./hanlp_run.sh" >> /var/spool/cron/root && service crond restart

+ 354 - 0
mapping/biddingmapping.json

@@ -0,0 +1,354 @@
+ curl -XPUT http://127.0.0.1:9800/bidding_v1 -d '{
+  "settings": {
+    "index": {
+      "analysis": {
+        "analyzer": {
+          "my_ngram_title": {
+            "filter": [
+              "lowercase"
+            ],
+            "tokenizer": "my_ngram_title"
+          },
+          "douhao": {
+            "type": "pattern",
+            "pattern": ","
+          },
+          "my_ngram": {
+            "filter": [
+              "lowercase"
+            ],
+            "tokenizer": "my_ngram"
+          }
+        },
+        "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": "8",
+      "number_of_replicas": "1"
+    }
+  },
+  "mappings": {
+    "bidding": {
+      "transform": {
+        "lang": "groovy",
+        "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]"
+      },
+      "_id": {
+        "path": "_id"
+      },
+      "_all": {
+        "enabled": false
+      },
+      "properties": {
+		"buyerzipcode": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"winnertel": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"winnerperson": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"contractcode": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"winneraddr": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"agencyaddr": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"buyeraddr": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"signaturedate": {
+		  "type": "long"
+		},
+		"projectperiod": {
+		  "index": "not_analyzed",
+          "type": "string"
+		},
+		"projectaddr": {
+		  "index": "not_analyzed",
+          "type": "string"
+		},
+		"agencytel": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"agencyperson": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"buyerperson": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"agency": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"projectscope": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"projectcode": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"bidopentime": {
+          "type": "long"
+        },
+		"supervisorrate": {
+		  "type": "double"
+		},
+		"buyertel": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"bidamount": {
+          "type": "double"
+        },
+		"winner": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"buyer": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"budget": {
+          "type": "double"
+        },
+		"projectname": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"s_projectname":{
+		  "type": "string"
+		},
+		"bidstatus": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"buyerclass": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"topscopeclass": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"s_subscopeclass": {
+          "analyzer": "douhao",
+          "type": "string"
+        },
+		"area": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"city": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"district": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"s_winner": {
+          "analyzer": "douhao",
+          "type": "string"
+        },
+		"id": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"title": {
+          "analyzer": "my_ngram_title",
+          "type": "string"
+        },
+		"detail": {
+          "analyzer": "my_ngram",
+          "type": "string"
+        },
+		"site": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"comeintime": {
+          "type": "long"
+        },
+		"href": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"infoformat": {
+          "type": "long"
+        },
+		"publishtime": {
+          "type": "long"
+        },
+		"s_sha": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"spidercode": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"toptype": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"subtype": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"projectinfo": {
+          "properties": {
+            "approvecode": {
+				"index": "not_analyzed",
+              "type": "string"
+            },
+            "approvecontent": {
+				"index": "not_analyzed",
+              "type": "string"
+            },
+            "approvestatus": {
+				"index": "not_analyzed",
+              "type": "string"
+            },
+            "approvetime": {
+				"index": "not_analyzed",
+              "type": "string"
+            },
+			 "approvedept": {
+				"index": "not_analyzed",
+              "type": "string"
+            },
+            "approvenumber": {
+				"index": "not_analyzed",
+              "type": "string"
+            },
+            "projecttype": {
+				"index": "not_analyzed",
+              "type": "string"
+            },
+            "approvecity": {
+				"index": "not_analyzed",
+              "type": "string"
+            }
+          }
+        },
+		"attachments": {
+		  "analyzer": "my_ngram",
+		  "type": "string"
+		},
+		"filetext": {
+		  "type":"string",
+		  "analyzer": "my_ngram"
+	    },
+		"purchasing": {
+		  "type":"string",
+		  "analyzer": "douhao"
+		},
+		"purchasinglist": {
+		  "properties":{
+			"itemname":{
+				"index": "not_analyzed",
+			  "type":"string"
+			},
+			"model":{
+				"index": "not_analyzed",
+			  "type":"string"
+			},
+			"unitname":{
+				"index": "not_analyzed",
+			  "type":"string"
+			},
+			"number":{
+			 "type":"double"
+			}
+		  }
+		},
+		"tagname":{
+		  "analyzer": "douhao",
+		  "type":"string"
+		},
+		"s_topscopeclass":{
+		  "analyzer": "douhao",
+		  "type":"string"
+		},
+		"channel": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"winnerorder": {
+		  "properties":{
+			"sort":{
+			  "type":"integer"
+			},
+			"sortstr":{
+				"index": "not_analyzed",
+			  "type":"string"
+			},
+			"entname":{
+				"index": "not_analyzed",
+			  "type":"string"
+			}
+		  }
+		}
+      }
+    }
+  }
+}'
+//ÐÂÔömapping
+curl -XPUT http://192.168.3.11:9800/bidding_v5/bidding/_mapping -d '
+{
+	"properties": {
+		"bidcycle":{
+			"type":"integer"
+		}
+	}
+}'
+
+
+
+
+"bidamount": {
+          "null_value": 0,
+          "type": "double"
+        },
+"budget": {
+          "null_value": 0,
+          "type": "double"
+        }

+ 318 - 0
mapping/biddingmapping_test.json

@@ -0,0 +1,318 @@
+ curl -XPUT http://192.168.3.11:9800/bidding_v5 -d '{
+  "settings": {
+    "index": {
+      "analysis": {
+        "analyzer": {
+          "my_ngram_title": {
+            "filter": [
+              "lowercase"
+            ],
+            "tokenizer": "my_ngram_title"
+          },
+          "douhao": {
+            "type": "pattern",
+            "pattern": ","
+          },
+          "my_ngram": {
+            "filter": [
+              "lowercase"
+            ],
+            "tokenizer": "my_ngram"
+          }
+        },
+        "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": "5",
+      "number_of_replicas": "0"
+    }
+  },
+  "mappings": {
+    "bidding": {
+      "transform": {
+        "lang": "groovy",
+        "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]"
+      },
+      "_id": {
+        "path": "_id"
+      },
+      "_all": {
+        "enabled": false
+      },
+      "properties": {
+		"buyerzipcode": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"winnertel": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"winnerperson": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"contractcode": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"winneraddr": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"agencyaddr": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"buyeraddr": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"signaturedate": {
+		  "type": "long"
+		},
+		"projectperiod": {
+		  "index": "not_analyzed",
+          "type": "string"
+		},
+		"projectaddr": {
+		  "index": "not_analyzed",
+          "type": "string"
+		},
+		"agencytel": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"agencyperson": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"buyerperson": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"agency": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"projectscope": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"projectcode": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"bidopentime": {
+          "type": "long"
+        },
+		"supervisorrate": {
+		  "type": "double"
+		},
+		"buyertel": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"bidamount": {
+          "type": "double"
+        },
+		"winner": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"buyer": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"budget": {
+          "type": "double"
+        },
+		"projectname": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"bidstatus": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"buyerclass": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"topscopeclass": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"s_subscopeclass": {
+          "analyzer": "douhao",
+          "type": "string"
+        },
+		"area": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"city": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"district": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"s_winner": {
+          "analyzer": "douhao",
+          "type": "string"
+        },
+		"id": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"title": {
+          "analyzer": "my_ngram_title",
+          "type": "string"
+        },
+		"detail": {
+          "analyzer": "my_ngram",
+          "type": "string"
+        },
+		"site": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"comeintime": {
+          "type": "long"
+        },
+		"href": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"infoformat": {
+          "type": "long"
+        },
+		"publishtime": {
+          "type": "long"
+        },
+		"s_sha": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"spidercode": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"toptype": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"subtype": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"projectinfo": {
+          "properties": {
+            "approvecode": {
+              "type": "string"
+            },
+            "approvecontent": {
+              "type": "string"
+            },
+            "approvestatus": {
+              "type": "string"
+            },
+            "approvetime": {
+              "type": "string"
+            },
+			 "approvedept": {
+              "type": "string"
+            },
+            "approvenumber": {
+              "type": "string"
+            },
+            "projecttype": {
+              "type": "string"
+            },
+            "approvecity": {
+              "type": "string"
+            }
+          }
+        },
+		"attachments": {
+		  "analyzer": "my_ngram",
+		  "type": "string"
+		},
+		"filetext": {
+		  "type":"string",
+		  "analyzer": "my_ngram"
+	    },
+		"purchasing": {
+		  "type":"string",
+		  "analyzer": "douhao"
+		},
+		"purchasinglist": {
+		  "properties":{
+			"itemname":{
+			  "type":"string"
+			},
+			"model":{
+			  "type":"string"
+			},
+			"unitname":{
+			  "type":"string"
+			},
+			"number":{
+			 "type":"double"
+			}
+		  }
+		},
+		"tagname":{
+		  "analyzer": "douhao",
+		  "type":"string"
+		},
+		"s_topscopeclass":{
+		  "analyzer": "douhao",
+		  "type":"string"
+		},
+		"channel": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"winnerorder": {
+		  "properties":{
+			"sort":{
+			  "type":"integer"
+			},
+			"sortstr":{
+			  "type":"string"
+			},
+			"entname":{
+			  "type":"string"
+			}
+		  }
+		}
+      }
+    }
+  }
+}'
+

+ 78 - 0
mapping/buyer.json

@@ -0,0 +1,78 @@
+curl -XPUT http://192.168.3.11:9800/buyer_v6 -d '{
+  "settings": {
+    "index": {
+      "analysis": {
+        "analyzer": {
+          "my_ngram": {
+            "tokenizer": "my_ngram"
+          }
+        },
+        "tokenizer": {
+          "my_ngram": {
+            "min_gram": "2",
+            "type": "nGram",
+            "max_gram": "2"
+          }
+        }
+      },
+      "number_of_shards": "5",
+      "number_of_replicas": "0"
+    }
+  },
+  "mappings": {
+    "buyer": {
+      "transform": {
+        "lang": "groovy",
+        "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]"
+      },
+      "_id": {
+        "path": "_id"
+      },
+      "_all": {
+        "enabled": false
+      },
+      "properties": {
+		"name":{
+		  "analyzer": "my_ngram",
+		  "type": "string"
+		},
+		"buyer_name": {
+			"index": "not_analyzed",
+			"type": "string"
+		},
+		"institute_type": {
+			"index": "not_analyzed",
+			"type": "string"
+		},
+		"buyerclass": {
+			"index": "not_analyzed",
+			"type": "string"
+		},	
+		"fixedphone": {
+			"index": "not_analyzed",
+			"type": "string"
+		},	
+		"mobilephone": {
+			"index": "not_analyzed",
+			"type": "string"
+		},	
+		"latestfixedphone": {
+			"index": "not_analyzed",
+			"type": "string"
+		},	
+		"latestmobilephone": {
+			"index": "not_analyzed",
+			"type": "string"
+		},
+		"province": {
+			"index": "not_analyzed",
+			"type": "string"
+		},
+		"city": {
+			"index": "not_analyzed",
+			"type": "string"
+		}	
+      }
+    }
+  }
+}'

+ 195 - 0
mapping/entmapping.json

@@ -0,0 +1,195 @@
+ curl -XPUT http://127.0.0.1:9800/qyxy_all -d '{
+  "settings": {
+    "index": {
+	  "analysis": {
+		"analyzer": {
+			"my_ngram": {
+				"filter": [
+					"lowercase"
+				],
+				"tokenizer": "my_ngram"
+			}
+		},
+		"tokenizer": {
+			"my_ngram": {
+				"type": "nGram",
+				"min_gram": "2",
+				"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": {
+		 "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"
+        },
+		"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": {
+		 "index": "not_analyzed",
+          "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"
+				}
+			}
+		},
+		"updatetime": {
+          "type": "long"
+        }
+      }
+    }
+  }
+}'

+ 43 - 0
mapping/es查询语句样例.json

@@ -0,0 +1,43 @@
+{
+  "query": {
+    "filtered": {
+      "filter": {
+        "bool": {
+          "must": [
+            {
+              "term": {
+                "buyer": "常熟市古里镇人民政府"
+              }
+            }
+          ]
+        }
+      },
+      "query": {
+        "bool": {
+          "should": [
+            {
+              "multi_match": {
+                "query": "电脑",
+                "type": "phrase",
+                "fields": [
+                  "purchasing",
+                  "projectname"
+                ]
+              }
+            },
+            {
+              "multi_match": {
+                "query": "计算机",
+                "type": "phrase",
+                "fields": [
+                  "purchasing",
+                  "projectname"
+                ]
+              }
+            }
+          ]
+        }
+      }
+    }
+  }
+}

+ 391 - 0
mapping/project.json

@@ -0,0 +1,391 @@
+ curl -XPUT http://127.0.0.1:9800/project_v1 -d '{
+  "settings": {
+    "index": {
+      "analysis": {
+        "analyzer": {
+          "douhao": {
+            "type": "pattern",
+            "pattern": ","
+          },
+          "my_ngram": {
+            "filter": [
+              "lowercase"
+            ],
+            "tokenizer": "my_ngram"
+          }
+        },
+        "tokenizer": {
+          "my_ngram": {
+            "token_chars": [
+              "letter",
+              "digit"
+            ],
+            "min_gram": "2",
+            "type": "nGram",
+            "max_gram": "2"
+          }
+        }
+      },
+      "number_of_shards": "8",
+      "number_of_replicas": "0"
+    }
+  },
+  "mappings": {
+    "projectset": {
+      "transform": {
+        "lang": "groovy",
+        "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]"
+      },
+      "_id": {
+        "path": "_id"
+      },
+      "_all": {
+        "enabled": false
+      },
+      "properties": {
+		"firsttime": {
+		  "type": "long"
+		},
+		"city": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"projectcode": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"jgtime": {
+		  "type": "long"
+		},
+		"projectscope": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"multipackage": {
+		  "type": "integer"
+		},
+		"subscopeclass": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"sortprice": {
+		  "type": "double"
+		},
+		"s_projectname": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"id": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"budget": {
+		  "type": "double"
+		},
+		"s_subscopeclass": {
+		  "type": "string"
+		},
+		"area": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"mpc": {
+		  "type": "string"
+		},
+		"bidamount": {
+		  "type": "double"
+		},
+		"createtime": {
+		  "type": "long"
+		},
+		"projectname": {
+		  "index": "not_analyzed",
+		  "type": "string",
+		  "fields": {
+		    "pname": {
+		      "analyzer": "my_ngram",
+		      "type": "string"
+		    }
+		  }
+		},
+		"buyertel": {
+		  "type": "string"
+		},
+		"agency": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"bidstatus": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"s_winner": {
+		  "analyzer": "douhao",
+		  "type": "string"
+		},
+		"winnerorder": {
+		  "properties": {
+		    "sortstr": {
+		      "type": "string"
+		    },
+		    "entname": {
+		      "type": "string"
+		    },
+		    "price": {
+		      "type": "long"
+		    },
+			"sort": {
+			  "type": "long"
+			},
+			"type": {
+			  "type": "long"
+			}
+		  }
+		},
+		"mpn": {
+		  "type": "string"
+		},
+		"pici": {
+		  "type": "long"
+		},
+		"list": {
+		  "properties": {
+		    "city": {
+		      "type": "string"
+		    },
+			"district": {
+		      "type": "string"
+		    },
+			"site": {
+		      "type": "string"
+		    },
+			"spidercode": {
+		      "type": "string"
+		    },
+			"multipackage": {
+			  "type": "long"
+		    },
+		    "projectcode": {
+		      "type": "string"
+		    },
+			"contractcode": {
+		      "type": "string"
+		    },
+		    "projectscope": {
+		      "type": "string"
+		    },
+		    "title": {
+		      "type": "string"
+		    },
+		    "comeintime": {
+		      "type": "long"
+		    },
+		    "toptype": {
+		      "type": "string"
+		    },
+		    "subtype": {
+		      "type": "string"
+		    },
+		    "infoformat": {
+		      "type": "long"
+		    },
+		    "href": {
+		      "type": "string"
+		    },
+		    "pjVal": {
+		      "type": "long"
+		    },
+		    "budget": {
+		      "type": "long"
+		    },
+		    "area": {
+		      "type": "string"
+		    },
+		    "bidamount": {
+		      "type": "long"
+		    },
+		    "projectname": {
+		      "type": "string"
+		    },
+		    "buyertel": {
+		      "type": "string"
+		    },
+		    "infoid": {
+		      "type": "string"
+		    },
+		    "agency": {
+		      "type": "string"
+		    },
+		    "compareStr": {
+		      "type": "string"
+		    },
+		    "bidstatus": {
+		      "type": "string"
+		    },
+		    "resVal": {
+		      "type": "long"
+		    },
+		    "buyer": {
+		      "type": "string"
+		    },
+		    "buyerclass": {
+		      "type": "string"
+		    },
+		    "winner": {
+		      "type": "string"
+		    },
+			"s_winner": {
+		      "type": "string"
+		    },
+		    "bidopentime": {
+		      "type": "string"
+		    },
+		    "publishtime": {
+		      "type": "long"
+		    },
+		    "topscopeclass": {
+		      "type": "string"
+		    },
+			"subscopeclass": {
+		      "type": "string"
+		    },
+		    "buyerperson": {
+		      "type": "string"
+		    }
+		  }
+		},
+		"buyer": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"bidtype": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"buyerclass": {
+		  "type": "string"
+		},
+		"sourceinfoid": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"sourceinfourl": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"lasttime": {
+		  "type": "long"
+		},
+		"winner": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"bidopentime": {
+		  "type": "long"
+		},
+		"district": {
+		  "type": "string"
+		},
+		"extractpos": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"ids": {
+		  "type": "string"
+		},
+		"topscopeclass": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"buyerperson": {
+		  "type": "string"
+		},
+		"zbtime": {
+		  "type": "long"
+		},
+		"contractcode": {
+		  "index": "not_analyzed",
+		  "type": "string"
+		},
+		"exception": {
+		  "type": "integer"
+		},
+		"results1": {
+		  "properties": {
+		    "code": {
+		      "type": "string"
+		    },
+		    "level": {
+		      "type": "string"
+		    },
+		    "column": {
+		      "type": "string"
+		    },
+			"pici": {
+			  "type": "long"
+			},
+			"describtion": {
+			  "type": "string"
+			}
+		  }
+		},
+		"flag_buyerclass": {
+		  "type": "long"
+		},
+		"flag_budget": {
+		  "type": "long"
+		},
+		"budgettag": {
+		  "type": "integer"
+		},
+		"project_rate": {
+		  "type": "double"
+		},
+		"projecthref": {
+		  "type": "string"
+		},
+		"flag": {
+		  "type": "string"
+		},
+		"flag_agency": {
+		  "type": "long"
+		},
+		"flag_firsttime": {
+		  "type": "long"
+		},
+		"b": {
+		  "type": "string"
+		},
+		"listtag": {
+		  "type": "long"
+		},
+		"bidamounttag": {
+		  "type": "integer"
+		},
+		"package1": {
+		  "properties": {
+		    "bidamount": {
+		      "type": "long"
+		    },
+		    "winner": {
+		      "index": "not_analyzed",
+		      "type": "string"
+		    }
+		  }
+		},
+		"flag_winner": {
+		  "type": "long"
+		},
+		"flag_buyer": {
+		  "type": "long"
+		},
+		"flag_bidamount": {
+		  "type": "long"
+		},
+		"clean_time": {
+		  "type": "long"
+		}		
+	  }
+    }
+  }
+}'

+ 376 - 0
mapping/projectset.json

@@ -0,0 +1,376 @@
+curl -XPUT http://127.0.0.1:9800/projectset_v1 -d '{
+  "settings": {
+    "index": {
+      "analysis": {
+        "analyzer": {
+          "douhao": {
+            "type": "pattern",
+            "pattern": ","
+          },
+          "my_ngram": {
+            "filter": [
+              "lowercase"
+            ],
+            "tokenizer": "my_ngram"
+          }
+        },
+        "tokenizer": {
+          "my_ngram": {
+            "token_chars": [
+              "letter",
+              "digit"
+            ],
+            "min_gram": "2",
+            "type": "nGram",
+            "max_gram": "2"
+          }
+        }
+      },
+      "number_of_shards": "2",
+      "number_of_replicas": "1"
+    }
+  },
+  "mappings": {
+    "projectset": {
+      "transform": {
+        "lang": "groovy",
+        "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]"
+      },
+      "_id": {
+        "path": "_id"
+      },
+      "_all": {
+        "enabled": false
+      },
+	  "properties":{
+        "exception":{
+            "type":"integer"
+        },
+        "projecthref":{
+		    "index":"not_analyzed",
+            "type":"string"
+        },
+        "firsttime":{
+            "type":"long"
+        },
+        "city":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "projectcode":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "jgtime":{
+            "type":"long"
+        },
+        "projectscope":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "multipackage":{
+            "type":"integer"
+        },
+        "subscopeclass":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "contractcode":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "sortprice":{
+            "type":"double"
+        },
+        "s_projectname":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "sourceinfourl":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "id":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "budget":{
+            "type":"double"
+        },
+        "s_subscopeclass":{
+			"index":"not_analyzed",
+            "type":"string"
+        },
+        "area":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "budgettag":{
+            "type":"long"
+        },
+        "mpc":{
+			"index":"not_analyzed",
+            "type":"string"
+        },
+        "bidamount":{
+            "type":"double"
+        },
+        "createtime":{
+            "type":"long"
+        },
+        "projectname":{
+            "index":"not_analyzed",
+            "type":"string",
+            "fields":{
+                "pname":{
+                    "analyzer":"my_ngram",
+                    "type":"string"
+                }
+            }
+        },
+        "buyertel":{
+			"index":"not_analyzed",
+            "type":"string"
+        },
+        "agency":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "listtag":{
+            "type":"integer"
+        },
+        "bidstatus":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "s_winner":{
+            "analyzer":"douhao",
+            "type":"string"
+        },
+        "bidamounttag":{
+            "type":"long"
+        },
+        "mpn":{
+			"index":"not_analyzed",
+            "type":"string"
+        },
+        "package1":{
+            "properties":{
+                "bidamount":{
+                    "type":"long"
+                },
+                "winner":{
+					"index":"not_analyzed",
+                    "type":"string"
+                }
+            }
+        },
+        "pici":{
+            "type":"long"
+        },
+        "list":{
+            "properties":{
+                "city":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "projectcode":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "projectscope":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "multipackage":{
+                    "type":"long"
+                },
+                "title":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "subscopeclass":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "comeintime":{
+                    "type":"long"
+                },
+                "contractcode":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "toptype":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "spidercode":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "subtype":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "infoformat":{
+                    "type":"long"
+                },
+                "href":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "pjVal":{
+                    "type":"long"
+                },
+                "budget":{
+                    "type":"long"
+                },
+                "area":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "bidamount":{
+                    "type":"long"
+                },
+                "projectname":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "buyertel":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "infoid":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "agency":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "compareStr":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "bidstatus":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "s_winner":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "resVal":{
+                    "type":"long"
+                },
+                "buyer":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "buyerclass":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "site":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "winner":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "bidopentime":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "district":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "publishtime":{
+                    "type":"long"
+                },
+                "topscopeclass":{
+					"index":"not_analyzed",
+                    "type":"string"
+                },
+                "buyerperson":{
+					"index":"not_analyzed",
+                    "type":"string"
+                }
+            }
+        },
+        "buyer":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "bidtype":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "buyerclass":{
+			"index":"not_analyzed",
+            "type":"string"
+        },
+        "sourceinfoid":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "lasttime":{
+            "type":"long"
+        },
+        "winner":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "bidopentime":{
+            "type":"long"
+        },
+        "district":{
+			"index":"not_analyzed",
+            "type":"string"
+        },
+        "extractpos":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "ids":{
+			"index":"not_analyzed",
+            "type":"string"
+        },
+        "project_rate":{
+            "type":"double"
+        },
+        "topscopeclass":{
+            "index":"not_analyzed",
+            "type":"string"
+        },
+        "buyerperson":{
+			"index":"not_analyzed",
+            "type":"string"
+        },
+        "zbtime":{
+            "type":"long"
+        },
+		"purchasing": {
+		  "type":"string",
+		  "analyzer": "my_ngram"
+		},
+		"review_experts":{
+			"index":"not_analyzed",
+            "type":"string"
+        },
+		"winnerorder": {
+			"index":"not_analyzed",
+            "type":"string"
+		},
+		"prate_flag": {
+            "type":"integer"
+		},
+		"bidcycle": {
+            "type":"integer"
+		}
+      }
+    }
+  }
+}'

+ 67 - 0
mapping/winner.json

@@ -0,0 +1,67 @@
+curl -XPUT http://127.0.0.1:9800/winner_v3 -d '{
+  "settings": {
+    "index": {
+      "analysis": {
+        "analyzer": {
+          "my_ngram": {
+            "tokenizer": "my_ngram"
+          }
+        },
+        "tokenizer": {
+          "my_ngram": {
+            "min_gram": "2",
+            "type": "nGram",
+            "max_gram": "2"
+          }
+        }
+      },
+      "number_of_shards": "8",
+      "number_of_replicas": "0"
+    }
+  },
+  "mappings": {
+    "winner": {
+      "transform": {
+        "lang": "groovy",
+        "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]"
+      },
+      "_id": {
+        "path": "_id"
+      },
+      "_all": {
+        "enabled": false
+      },
+      "properties": {
+	    "winnersign": {
+          "type": "long"
+        },
+		"l_createtime": {
+          "type": "long"
+        },
+		"name":{
+		  "analyzer": "my_ngram",
+		  "type": "string"
+		},
+		"id": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"pici": {
+           "type": "long"
+        },
+		"province": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"city": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"winner_name": {
+          "index": "not_analyzed",
+          "type": "string"
+        }
+      }
+    }
+  }
+}'

+ 143 - 0
mapping/winnermapping.json

@@ -0,0 +1,143 @@
+ curl -XPUT http://127.0.0.1:9800/winner_enterprise -d '{
+  "settings": {
+    "index": {
+      "analysis": {
+        "analyzer": {
+          "my_ngram": {
+            "tokenizer": "my_ngram"
+          }
+        },
+        "tokenizer": {
+          "my_ngram": {
+            "min_gram": "2",
+            "type": "nGram",
+            "max_gram": "2"
+          }
+        }
+      },
+      "number_of_shards": "6",
+      "number_of_replicas": "0"
+    }
+  },
+  "mappings": {
+    "winner_enterprise": {
+      "transform": {
+        "lang": "groovy",
+        "script": "ctx._source[\"id\"] = ctx._source[\"_id\"]"
+      },
+      "_id": {
+        "path": "_id"
+      },
+      "_all": {
+        "enabled": false
+      },
+      "properties": {
+		"company_name":{
+		  "analyzer": "my_ngram",
+		  "type": "string"
+		},
+		"history_name": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"credit_no": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"area_code": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"province": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"city": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"district": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"company_type": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"legal_person": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"establish_date": {
+          "type": "long"
+        },
+		"capital": {
+          "type": "float"
+        },
+		"company_address": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"business_scope": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"wechat_accounts": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"website": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"partners": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"stock_type": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"stock_name": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"stock_capital": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"stock_realcapital": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"industry": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"contact": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"contact_person": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"contact_type": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"phone": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"topscopeclass": {
+          "index": "not_analyzed",
+          "type": "string"
+        },
+		"updatetime": {
+          "type": "long"
+        }
+      }
+    }
+  }
+}'

+ 9 - 0
mapping/新建索引库流程.txt

@@ -0,0 +1,9 @@
+1.执行mapping文件创建索引库
+2.执行节点平衡all--none
+
+######################生索引######################
+./sendtask -ip 127.0.0.1 -p 14833 -gtid 5a85ae800000000000000000  -lteid 5d8649000000000000000000 -stype biddingdata -param '{"coll":"bidding"}'
+1、新启一个生索引程序,udp端口修改了如2483
+2、生索引 stype使用biddingdata,对应配置在bidding段
+3、先跑bidding_back库,再跑bidding库,对应抽取在extract_v3库result_v3表
+5、生索引生到bidding_v4中,先跑一条,然后看看结果对不对http://127.0.0.1:9800/bidding_v4/bidding/5b679d10a5cb26b9b7a5555e?pretty

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

@@ -0,0 +1,41 @@
+curl -XPOST http://127.0.0.1:9800/_aliases -d '
+{
+    "actions": [
+        { "remove": {
+            "alias": "bidding",
+            "index": "bidding_v2"
+        }},
+        { "add": {
+            "alias": "bidding",
+            "index": "bidding_v1"
+        }}
+    ]
+}'
+
+curl -XPOST http://127.0.0.1:9800/_aliases -d '
+{
+    "actions": [
+        { "remove": {
+            "alias": "buyer",
+            "index": "buyer_v2"
+        }},
+        { "add": {
+            "alias": "buyer",
+            "index": "buyer_v1"
+        }}
+    ]
+}'
+
+curl -XPOST http://127.0.0.1:9800/_aliases -d '
+{
+    "actions": [
+        { "remove": {
+            "alias": "winner",
+            "index": "winner_v2"
+        }},
+        { "add": {
+            "alias": "winner",
+            "index": "winner_v3"
+        }}
+    ]
+}'

+ 4 - 0
mapping/注意.txt

@@ -0,0 +1,4 @@
+bidding索引:
+	1、biddingindex和biddingall生索引的json文件不一样(filetext,purchasing,purchasinglist)
+	2、filetext,purchasing,purchasinglist生索引目前在定时任务中,后续改入biddingindex
+	

+ 45 - 0
mapping/节点平衡.txt

@@ -0,0 +1,45 @@
+//开启节点平衡
+curl -XPUT http://127.0.0.1:9800/_cluster/settings -d'{
+  "transient" : {
+    "cluster.routing.allocation.enable" : "all"
+  }
+}'
+
+//关闭节点平衡
+curl -XPUT http://127.0.0.1:9800/_cluster/settings -d'{
+  "transient" : {
+    "cluster.routing.allocation.enable" : "none"
+  }
+}'
+//开启节点平衡
+curl -XPUT http://192.168.3.128:9800/_cluster/settings -d'{
+  "transient" : {
+    "cluster.routing.allocation.enable" : "all"
+  }
+}'
+
+//关闭节点平衡
+curl -XPUT http://192.168.3.128:9800/_cluster/settings -d'{
+  "transient" : {
+    "cluster.routing.allocation.enable" : "none"
+  }
+}'
+//手动移动节点
+curl -XPOST 'http://127.0.0.1:9800/_cluster/reroute' -d '{
+    "commands" : [ {
+        "move" : 
+            {
+              "index" : "bidding_v1", "shard" : 5, 
+              "from_node" : "793VjTv8Rze4LGvjK0pNUw", "to_node" : "KmsGnH3EQeiwT92SOzR7KQ"
+            }
+        }
+      
+    ]
+}'
+//查看节点个数
+curl http://localhost:9800/_settings?pretty
+
+//设置节点个数
+curl -XPUT 'http://127.0.0.1:9800/bidding_v1/_settings' -d '{
+"index.routing.allocation.total_shards_per_node":2
+}'