Fix compile error in weaviate repository
This commit is contained in:
@@ -429,7 +429,7 @@ func (w *weaviateRepository) BatchUpdateChunkTagID(ctx context.Context, chunkTag
|
|||||||
// Get all collections
|
// Get all collections
|
||||||
collections, err := w.ListCollections(ctx)
|
collections, err := w.ListCollections(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("[Weaviate] Failed to list collections: %w", err)
|
log.Errorf("[Weaviate] Failed to list collections: %v", err)
|
||||||
return fmt.Errorf("failed to list collections: %w", err)
|
return fmt.Errorf("failed to list collections: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -566,10 +566,10 @@ func (w *weaviateRepository) VectorRetrieve(ctx context.Context,
|
|||||||
log.Errorf("[Weaviate] Vector search failed: %v", err)
|
log.Errorf("[Weaviate] Vector search failed: %v", err)
|
||||||
return nil, fmt.Errorf("failed to search: %w", err)
|
return nil, fmt.Errorf("failed to search: %w", err)
|
||||||
}
|
}
|
||||||
if len(result.Errors) > 0 {
|
if len(result.Errors) > 0 {
|
||||||
log.Errorf("[Weaviate] Vector search failed: %v", result.Errors)
|
log.Errorf("[Weaviate] Vector search failed: %v", result.Errors)
|
||||||
return nil, fmt.Errorf("graphql search failed: %w", result.Errors[0].Message)
|
return nil, fmt.Errorf("graphql search failed: %s", result.Errors[0].Message)
|
||||||
}
|
}
|
||||||
|
|
||||||
data, ok := result.Data["Get"].(map[string]interface{})
|
data, ok := result.Data["Get"].(map[string]interface{})
|
||||||
if !ok || data[collectionName] == nil {
|
if !ok || data[collectionName] == nil {
|
||||||
@@ -637,7 +637,7 @@ func (w *weaviateRepository) KeywordsRetrieve(ctx context.Context,
|
|||||||
}
|
}
|
||||||
if len(result.Errors) > 0 {
|
if len(result.Errors) > 0 {
|
||||||
log.Errorf("[Weaviate] keywords search failed: %v", result.Errors)
|
log.Errorf("[Weaviate] keywords search failed: %v", result.Errors)
|
||||||
return nil, fmt.Errorf("graphql search failed: %w", result.Errors[0].Message)
|
return nil, fmt.Errorf("graphql search failed: %s", result.Errors[0].Message)
|
||||||
}
|
}
|
||||||
data, ok := result.Data["Get"].(map[string]interface{})
|
data, ok := result.Data["Get"].(map[string]interface{})
|
||||||
if !ok || data[collectionName] == nil {
|
if !ok || data[collectionName] == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user