|
@@ -24,75 +24,74 @@ func Task() {
|
|
|
|
|
|
//修复报告内容
|
|
|
//GetArticleAll()
|
|
|
-
|
|
|
//indexName := "article_list"
|
|
|
// mappingJson := `{
|
|
|
//"mappings": {
|
|
|
- // "dynamic": true,
|
|
|
- // "properties": {
|
|
|
- // "ArticleId": {
|
|
|
- // "type": "integer"
|
|
|
- // },
|
|
|
- // "Title": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // },
|
|
|
- // "TitleEn": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // },
|
|
|
- // "UpdateFrequency": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // },
|
|
|
- // "CreateDate": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // },
|
|
|
- // "PublishDate": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // },
|
|
|
- // "Abstract": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // },
|
|
|
- // "CategoryName": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // },
|
|
|
- // "SubCategoryName": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // },
|
|
|
- // "InterviewDate": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // },
|
|
|
- // "ExpertBackground": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // },
|
|
|
- // "ExpertNumber": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // },
|
|
|
- // "Department": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // },
|
|
|
- // "BodyText": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // },
|
|
|
- // "ArticleIdMd5": {
|
|
|
- // "type": "text",
|
|
|
- // "analyzer": "ik_smart"
|
|
|
- // }
|
|
|
- // }
|
|
|
+ // "dynamic": true,
|
|
|
+ // "properties": {
|
|
|
+ // "ArticleId": {
|
|
|
+ // "type": "integer"
|
|
|
+ // },
|
|
|
+ // "Title": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // },
|
|
|
+ // "TitleEn": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // },
|
|
|
+ // "UpdateFrequency": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // },
|
|
|
+ // "CreateDate": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // },
|
|
|
+ // "PublishDate": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // },
|
|
|
+ // "Abstract": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // },
|
|
|
+ // "CategoryName": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // },
|
|
|
+ // "SubCategoryName": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // },
|
|
|
+ // "InterviewDate": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // },
|
|
|
+ // "ExpertBackground": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // },
|
|
|
+ // "ExpertNumber": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // },
|
|
|
+ // "Department": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // },
|
|
|
+ // "BodyText": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // },
|
|
|
+ // "ArticleIdMd5": {
|
|
|
+ // "type": "text",
|
|
|
+ // "analyzer": "ik_smart"
|
|
|
+ // }
|
|
|
+ // }
|
|
|
//}
|
|
|
//}`
|
|
|
- // EsCreateIndex(indexName,mappingJson)
|
|
|
+ //EsCreateIndex(indexName,mappingJson)
|
|
|
|
|
|
//插入数据
|
|
|
//allList, err := models.GetArticleAll()
|
|
@@ -142,9 +141,6 @@ func Task() {
|
|
|
////bm.Put(key,1,1*time.Second)
|
|
|
//b:=bm.IsExist(key)
|
|
|
//fmt.Println(b)
|
|
|
- indexName := "article_list"
|
|
|
- keyWord:=`康立明`
|
|
|
- EsV7Search(indexName,keyWord)
|
|
|
fmt.Println("end")
|
|
|
}
|
|
|
|