|
|
|
@@ -179,7 +179,7 @@ func searchRepo(ctx *context.Context, TableName string, Key string, Page int, Pa |
|
|
|
log.Info("query searchRepo start") |
|
|
|
if Key != "" { |
|
|
|
boolQ := elastic.NewBoolQuery() |
|
|
|
nameQuery := elastic.NewMatchQuery("name", Key).Boost(1024).QueryName("f_first") |
|
|
|
nameQuery := elastic.NewMatchQuery("alias", Key).Boost(1024).QueryName("f_first") |
|
|
|
descriptionQuery := elastic.NewMatchQuery("description", Key).Boost(1.5).QueryName("f_second") |
|
|
|
topicsQuery := elastic.NewMatchQuery("topics", Key).Boost(1).QueryName("f_third") |
|
|
|
boolQ.Should(nameQuery, descriptionQuery, topicsQuery) |
|
|
|
@@ -263,7 +263,7 @@ func makeRepoResult(sRes *elastic.SearchResult, Key string, OnlyReturnNum bool) |
|
|
|
if err == nil { |
|
|
|
record := make(map[string]interface{}) |
|
|
|
record["id"] = hit.Id |
|
|
|
record["name"] = getLabelValue("name", recordSource, hit.Highlight) |
|
|
|
record["alias"] = getLabelValue("alias", recordSource, hit.Highlight) |
|
|
|
record["real_name"] = recordSource["name"] |
|
|
|
record["owner_name"] = recordSource["owner_name"] |
|
|
|
if recordSource["description"] != nil { |
|
|
|
|