feat(knowledge): implement AminusB function for multiset comparison of knowledge bases
- Added AminusB method to the knowledgeRepository, which returns IDs of knowledge in A that have no counterpart in B, comparing by file_hash as a multiset. - This implementation addresses issues with handling duplicate entries and NULL file_hash values, ensuring accurate synchronization between knowledge bases. - Updated the KnowledgeRepository interface to reflect the new functionality and improved documentation for clarity.
This commit is contained in:
@@ -232,7 +232,9 @@ type KnowledgeRepository interface {
|
||||
kbID string,
|
||||
params *types.KnowledgeCheckParams,
|
||||
) (bool, *types.Knowledge, error)
|
||||
// AminusB returns the difference set of A and B.
|
||||
// AminusB returns the IDs of knowledge in A that have no counterpart in B,
|
||||
// comparing file_hash as a multiset (so duplicate-count differences and
|
||||
// NULL/empty hashes are handled correctly, letting a clone converge).
|
||||
AminusB(ctx context.Context, Atenant uint64, A string, Btenant uint64, B string) ([]string, error)
|
||||
UpdateKnowledgeColumn(ctx context.Context, id string, column string, value interface{}) error
|
||||
// UpdateKnowledgeColumns updates multiple columns of a knowledge row in a single
|
||||
|
||||
Reference in New Issue
Block a user