Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design: Are BlendedInfixSuggester's LINEAR_COEF and DEFAULT_NUM_FACTOR fields intended to be mutable? #14152

Open
paulirwin opened this issue Jan 18, 2025 · 0 comments

Comments

@paulirwin
Copy link

(Found during reviewing code while porting to the Lucene.NET project.)

BlendedInfixSuggester has two static, mutable fields that seem like they might have been intended to be constants instead: LINEAR_COEF and DEFAULT_NUM_FACTOR. We wanted to know whether it was intentional that these were mutable, or an oversight that should be corrected and both marked final.

DEFAULT_NUM_FACTOR does not seem to have much utility if it is modified, and could result in bugs if it is modified during execution. Perhaps there is good reasoning for modifying it, though, that could be documented on the field.

LINEAR_COEF seems like a possible use case for modifying it would be to change the algorithm's math, but if so it is unexpected then that it is protected instead of public.

Affects Lucene 4.7.0 through current (10.1.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant