feat:优化项目信息
This commit is contained in:
@ -33,13 +33,27 @@ func _new() *elastic.Client {
|
||||
return client
|
||||
}
|
||||
|
||||
type ESAchievement struct {
|
||||
ID uint64 `json:"id"` // 成果ID
|
||||
Title string `json:"title"` // 成果名称
|
||||
Industry string `json:"industry"` // 行业领域
|
||||
Keyword string `json:"keyword"` // 关键词
|
||||
}
|
||||
|
||||
func TestNewInstanceCreate(t *testing.T) {
|
||||
client := _new()
|
||||
//client.Delete()
|
||||
|
||||
src := Student{ID: 2, Name: "henry", Age: 28}
|
||||
client.Index().Index("student").Id(fmt.Sprintf("%d", src.ID)).BodyJson(utils.AnyToJSON(src)).
|
||||
//src := Student{ID: 2, Name: "henry", Age: 28}
|
||||
src := &ESAchievement{
|
||||
ID: 6,
|
||||
Title: "测试6",
|
||||
Industry: "测试测试",
|
||||
Keyword: "关键词1;关键词2",
|
||||
}
|
||||
_, err := client.Index().Index("es_achievement_index").Id(fmt.Sprintf("%d", src.ID)).BodyJson(utils.AnyToJSON(src)).
|
||||
Do(context.Background())
|
||||
t.Log(err)
|
||||
}
|
||||
|
||||
func TestNewInstanceUpdate(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user