| @@ -158,7 +158,7 @@ func makeRepoResult(sRes *elastic.SearchResult, Key string) *SearchRes { | |||||
| err = json.Unmarshal(source, &recordSource) | err = json.Unmarshal(source, &recordSource) | ||||
| if err == nil { | if err == nil { | ||||
| record := make(map[string]interface{}) | record := make(map[string]interface{}) | ||||
| record["id"] = recordSource["_id"] | |||||
| record["id"] = hit.Id | |||||
| record["name"] = recordSource["name"] | record["name"] = recordSource["name"] | ||||
| record["owner_name"] = recordSource["owner_name"] | record["owner_name"] = recordSource["owner_name"] | ||||
| if recordSource["description"] != nil { | if recordSource["description"] != nil { | ||||
| @@ -281,7 +281,7 @@ func makeUserOrOrgResult(sRes *elastic.SearchResult, Key string, ctx *context.Co | |||||
| err = json.Unmarshal(source, &recordSource) | err = json.Unmarshal(source, &recordSource) | ||||
| if err == nil { | if err == nil { | ||||
| record := make(map[string]interface{}) | record := make(map[string]interface{}) | ||||
| record["id"] = recordSource["_id"] | |||||
| record["id"] = hit.Id | |||||
| record["name"] = recordSource["name"] | record["name"] = recordSource["name"] | ||||
| record["full_name"] = recordSource["full_name"] | record["full_name"] = recordSource["full_name"] | ||||
| if recordSource["description"] != nil { | if recordSource["description"] != nil { | ||||
| @@ -382,7 +382,7 @@ func makeDatasetResult(sRes *elastic.SearchResult, Key string) *SearchRes { | |||||
| err = json.Unmarshal(source, &recordSource) | err = json.Unmarshal(source, &recordSource) | ||||
| if err == nil { | if err == nil { | ||||
| record := make(map[string]interface{}) | record := make(map[string]interface{}) | ||||
| record["id"] = recordSource["_id"] | |||||
| record["id"] = hit.Id | |||||
| userId := recordSource["user_id"].(int64) | userId := recordSource["user_id"].(int64) | ||||
| user, errUser := models.GetUserByID(userId) | user, errUser := models.GetUserByID(userId) | ||||
| if errUser == nil { | if errUser == nil { | ||||
| @@ -434,10 +434,11 @@ func searchIssue(ctx *context.Context, TableName string, Key string, Page int, P | |||||
| ascending := ctx.QueryBool("Ascending") | ascending := ctx.QueryBool("Ascending") | ||||
| boolQ := elastic.NewBoolQuery() | boolQ := elastic.NewBoolQuery() | ||||
| if Key != "" { | if Key != "" { | ||||
| log.Info("issue Key=" + Key) | |||||
| nameQuery := elastic.NewMatchQuery("name", Key).Boost(2).QueryName("f_first") | nameQuery := elastic.NewMatchQuery("name", Key).Boost(2).QueryName("f_first") | ||||
| contentQuery := elastic.NewMatchQuery("content", Key).Boost(1.5).QueryName("f_second") | contentQuery := elastic.NewMatchQuery("content", Key).Boost(1.5).QueryName("f_second") | ||||
| commentQuery := elastic.NewMatchQuery("comment", Key).Boost(1).QueryName("f_third") | commentQuery := elastic.NewMatchQuery("comment", Key).Boost(1).QueryName("f_third") | ||||
| boolQ.Should(nameQuery, contentQuery, commentQuery) | |||||
| boolQ.Must(nameQuery, contentQuery, commentQuery) | |||||
| } | } | ||||
| isIssueQuery := elastic.NewTermQuery("is_pull", "f") | isIssueQuery := elastic.NewTermQuery("is_pull", "f") | ||||
| boolQ.Must(isIssueQuery) | boolQ.Must(isIssueQuery) | ||||
| @@ -466,7 +467,7 @@ func makeIssueResult(sRes *elastic.SearchResult, Key string) *SearchRes { | |||||
| err = json.Unmarshal(source, &recordSource) | err = json.Unmarshal(source, &recordSource) | ||||
| if err == nil { | if err == nil { | ||||
| record := make(map[string]interface{}) | record := make(map[string]interface{}) | ||||
| record["id"] = recordSource["_id"] | |||||
| record["id"] = hit.Id | |||||
| record["repo_id"] = recordSource["repo_id"] | record["repo_id"] = recordSource["repo_id"] | ||||
| log.Info("recordSource[\"repo_id\"]=" + fmt.Sprint(recordSource["repo_id"])) | log.Info("recordSource[\"repo_id\"]=" + fmt.Sprint(recordSource["repo_id"])) | ||||
| repoIdstr := recordSource["repo_id"].(string) | repoIdstr := recordSource["repo_id"].(string) | ||||