From 828ae1e82f1364fb63d7296d7533e5062b7a61dd Mon Sep 17 00:00:00 2001 From: qinling0210 <88864212+qinling0210@users.noreply.github.com> Date: Mon, 19 Jan 2026 11:39:33 +0800 Subject: [PATCH] Round float value of minimum_should_match (#12688) ### What problem does this PR solve? In paragraph() of class FulltextQueryer, "len(keywords) / 10" should be rounded to integer before set to minimum_should_match. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/nlp/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/nlp/query.py b/rag/nlp/query.py index 402b240fe..096cfa4ce 100644 --- a/rag/nlp/query.py +++ b/rag/nlp/query.py @@ -232,5 +232,5 @@ class FulltextQueryer(QueryBase): keywords.append(f"{tk}^{w}") return MatchTextExpr(self.query_fields, " ".join(keywords), 100, - {"minimum_should_match": min(3, len(keywords) / 10), + {"minimum_should_match": min(3, round(len(keywords) / 10)), "original_query": " ".join(origin_keywords)})