Skip to content

Add BM25 k3 query-term frequency saturation to classic query parser#15818

Open
sgup432 wants to merge 3 commits intoapache:mainfrom
sgup432:query_parser_k3_saturation
Open

Add BM25 k3 query-term frequency saturation to classic query parser#15818
sgup432 wants to merge 3 commits intoapache:mainfrom
sgup432:query_parser_k3_saturation

Conversation

@sgup432
Copy link
Contributor

@sgup432 sgup432 commented Mar 13, 2026

Description

Related issue - #15768

Adds BM25 k3 parameter to the classic query parser for query-side term frequency saturation. Duplicate terms in a query string now get their boost computed as ((k3+1)*qtf)/(k3+qtf) instead of linear summing, when enabled via parser.setK3(8f).

Defaults to -1 (disabled) — fully backward compatible. Saturation is applied at parse time in QueryParserBase.getBooleanQuery() so BooleanQuery.rewrite() never sees duplicates.

@github-actions github-actions bot added this to the 11.0.0 milestone Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant