77 "encoding/hex"
88 "encoding/json"
99 "fmt"
10+ "github.com/zeromicro/go-zero/core/logx"
1011 "io"
1112 "math"
1213 "net/http"
@@ -391,8 +392,8 @@ func (r *weaviateWrapper) unmarshalSimilarSearchResponse(res *models.GraphQLResp
391392 continue
392393 }
393394
394- // content := getStringValue(obj, Content)
395- content := ""
395+ content := getStringValue (obj , Content )
396+
396397 filePath := getStringValue (obj , MetadataFilePath )
397398
398399 // 从MetadataRange中提取startLine和endLine(用于构建映射键)
@@ -1024,7 +1025,7 @@ func (r *weaviateWrapper) InsertCodeChunks(ctx context.Context, docs []*types.Co
10241025 if err != nil {
10251026 return err
10261027 }
1027- tracer .WithTrace (ctx ).Infof ("embedded %d chunks for codebase %s successfully" , len (docs ), docs [0 ].CodebaseName )
1028+ tracer .WithTrace (ctx ).Infof ("embedded %d chunks for codebase %s successfully" , len (chunks ), docs [0 ].CodebaseName )
10281029
10291030 objs := make ([]* models.Object , len (chunks ), len (chunks ))
10301031 for i , c := range chunks {
@@ -1311,14 +1312,14 @@ func (r *weaviateWrapper) createClassWithAutoTenantEnabled(client *goweaviate.Cl
13111312// generateTenantName 使用 MD5 哈希生成合规租户名(32字符,纯十六进制)
13121313func (r * weaviateWrapper ) generateTenantName (clientId string , codebasePath string ) (string , error ) {
13131314 // 添加调试日志
1314- fmt . Printf ("[DEBUG] generateTenantName - 输入 clientId: %s, codebasePath: %s\n " , clientId , codebasePath )
1315+ logx . Debugf ("[DEBUG] generateTenantName - 输入 clientId: %s, codebasePath: %s\n " , clientId , codebasePath )
13151316
13161317 if codebasePath == types .EmptyString {
1317- fmt . Printf ("[DEBUG] generateTenantName - codebasePath 为空字符串\n " )
1318+ logx . Debugf ("[DEBUG] generateTenantName - codebasePath 为空字符串\n " )
13181319 return types .EmptyString , ErrInvalidCodebasePath
13191320 }
13201321 if clientId == types .EmptyString {
1321- fmt . Printf ("[DEBUG] generateTenantName - clientId 为空字符串\n " )
1322+ logx . Debugf ("[DEBUG] generateTenantName - clientId 为空字符串\n " )
13221323 return types .EmptyString , ErrInvalidClientId
13231324 }
13241325
@@ -1327,7 +1328,7 @@ func (r *weaviateWrapper) generateTenantName(clientId string, codebasePath strin
13271328 hash := md5 .Sum ([]byte (combined )) // 计算 MD5 哈希
13281329 tenantName := hex .EncodeToString (hash [:]) // 转为32位十六进制字符串
13291330
1330- fmt . Printf ("[DEBUG] generateTenantName - 生成的 tenantName: %s\n " , tenantName )
1331+ logx . Debugf ("[DEBUG] generateTenantName - 生成的 tenantName: %s\n " , tenantName )
13311332 return tenantName , nil
13321333}
13331334
0 commit comments