fix: exclude compiled artifacts from chunk lists (#18382)

This commit is contained in:
buua436
2026-08-18 09:41:27 +08:00
committed by GitHub
parent b85b908bb6
commit f5efff8d6d
2 changed files with 6 additions and 1 deletions

View File

@@ -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"},
},
}

View File

@@ -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)
}