feat: add ListChunksByParentIDs method and enhance chunk merging logic
- Implemented ListChunksByParentIDs in chunkRepository to retrieve chunks based on multiple parent IDs, improving data retrieval efficiency. - Enhanced the chunk merging logic in PluginMerge to better handle overlapping chunks and collect merged ImageInfo for parent chunks. - Updated the ChunkRepository interface to include the new ListChunksByParentIDs method, ensuring consistency across the application. These changes optimize chunk management and improve the handling of image information during merges, enhancing overall application functionality.
This commit is contained in:
@@ -44,6 +44,8 @@ type ChunkRepository interface {
|
||||
knowledgeType string,
|
||||
) ([]*types.Chunk, int64, error)
|
||||
ListChunkByParentID(ctx context.Context, tenantID uint64, parentID string) ([]*types.Chunk, error)
|
||||
// ListChunksByParentIDs lists chunks whose parent_chunk_id is in the given list
|
||||
ListChunksByParentIDs(ctx context.Context, tenantID uint64, parentIDs []string) ([]*types.Chunk, error)
|
||||
// UpdateChunk updates a chunk
|
||||
UpdateChunk(ctx context.Context, chunk *types.Chunk) error
|
||||
// UpdateChunks updates chunks in batch
|
||||
|
||||
Reference in New Issue
Block a user