msfroh commented on code in PR #15818:
URL: https://github.com/apache/lucene/pull/15818#discussion_r3001710111
##########
lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java:
##########
@@ -1038,4 +1039,122 @@ private boolean isAHit(Query q, String content,
Analyzer analyzer) throws IOExce
return false;
}
}
+
+ public void testK3DefaultDisabled() throws Exception {
+ QueryParser qp = getParser(new MockAnalyzer(random()));
+ // Parser no longer has k3 — it always produces raw duplicate clauses.
+ // With default BM25Similarity (k3 disabled), BooleanQuery.rewrite
produces linear boost sum.
Review Comment:
Do you still need these tests in `TestQueryParser`? Or are the tests in
`TestBM25Similarity` sufficient now?
##########
lucene/CHANGES.txt:
##########
@@ -86,6 +86,8 @@ New Features
* GITHUB#15508: Use native vectorization in Lucene. (Ankur Goel, Shubham
Chaudhary, Dawid Weiss)
+* GITHUB#15818: Add BM25 k3 query-term frequency saturation to classic query
parser. (Sagar Upadhyaya)
Review Comment:
Need to update the changelog entry, since you've now changed it at the
`Similarity` level instead of the classic query parser.
##########
lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java:
##########
@@ -660,6 +660,7 @@ protected Query getBooleanQuery(List<BooleanClause>
clauses) throws ParseExcepti
if (clauses.isEmpty()) {
return null; // all clause words were filtered away by the analyzer.
}
+
Review Comment:
Can revert this newline, since you're not changing `QueryParserBase`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]