Refact functions in engine in GO (#14981)

### What problem does this PR solve?

Refact functions in engine in GO
### Type of change

- [x] Refactoring
This commit is contained in:
qinling0210
2026-05-19 17:34:59 +08:00
committed by GitHub
parent 6b2fcb4116
commit 77834870fc
22 changed files with 3805 additions and 3201 deletions

View File

@@ -236,7 +236,7 @@ func (h *DatasetsHandler) GetKnowledgeGraph(c *gin.Context) {
}
indexName := fmt.Sprintf("ragflow_%s", tenantID)
exists, err := docEngine.TableExists(c.Request.Context(), indexName)
exists, err := docEngine.ChunkStoreExists(c.Request.Context(), indexName, datasetID)
if err != nil {
jsonError(c, common.CodeServerError, err.Error())
return
@@ -335,7 +335,7 @@ func (h *DatasetsHandler) DeleteKnowledgeGraph(c *gin.Context) {
}
indexName := fmt.Sprintf("ragflow_%s", tenantID)
if _, err := docEngine.Delete(c.Request.Context(), map[string]interface{}{
if _, err := docEngine.DeleteChunks(c.Request.Context(), map[string]interface{}{
"knowledge_graph_kwd": []string{"graph", "subgraph", "entity", "relation", "community_report"},
}, indexName, datasetID); err != nil {
jsonError(c, common.CodeServerError, err.Error())

View File

@@ -650,7 +650,7 @@ func (h *KnowledgebaseHandler) InsertDatasetFromFile(c *gin.Context) {
// Get the document engine and insert
docEngine := engine.Get()
result, err := docEngine.InsertDataset(c.Request.Context(), debugFormat.Chunks, debugFormat.TableNamePrefix, debugFormat.KnowledgebaseID)
result, err := docEngine.InsertChunks(c.Request.Context(), debugFormat.Chunks, debugFormat.TableNamePrefix, debugFormat.KnowledgebaseID)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{
"code": 500,