mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-19 06:48:25 +08:00
fix: exclude compiled artifacts from chunk lists (#18382)
This commit is contained in:
@@ -882,7 +882,8 @@ func (s *ChunkService) List(ctx context.Context, req *service.ListChunksRequest,
|
||||
"available_int",
|
||||
},
|
||||
Filter: map[string]interface{}{
|
||||
"doc_id": req.DocID,
|
||||
"doc_id": req.DocID,
|
||||
"must_not": map[string]interface{}{"exists": "compile_kwd"},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -405,6 +405,10 @@ func TestListBuildsMatchTextExprForKeywords(t *testing.T) {
|
||||
if got := engine.searchReq.Filter["doc_id"]; got != documentID {
|
||||
t.Fatalf("doc_id filter = %#v, want %q", got, documentID)
|
||||
}
|
||||
mustNot, ok := engine.searchReq.Filter["must_not"].(map[string]interface{})
|
||||
if !ok || mustNot["exists"] != "compile_kwd" {
|
||||
t.Fatalf("must_not filter = %#v, want compile_kwd existence exclusion", engine.searchReq.Filter["must_not"])
|
||||
}
|
||||
if slices.Contains(engine.searchReq.SelectFields, "content") {
|
||||
t.Fatalf("SelectFields = %#v, should not request content with content_with_weight", engine.searchReq.SelectFields)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user