[ https://issues.apache.org/jira/browse/LUCENE-8099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16308740#comment-16308740 ]
Hoss Man commented on LUCENE-8099: ---------------------------------- I'm coming at this kind of late -- but I have to say i'm -1 to this change. What exactly is the motivation here? If the goal is to reduce "similar" code in Lucene, then that's fine -- we can/should certainly refactor these classes to consolidate their implementation -- but why deprecate/remove them completely? Look at this example of a suggested replcament in the javadocs... {noformat} * Query balancedQuery = new BoostingQuery(positiveQuery, negativeQuery, 0.01f); ... * Clients should instead use FunctionScoreQuery and the lucene-expressions library: * <pre> * SimpleBindings bindings = new SimpleBindings(); * bindings.add("score", DoubleValuesSource.SCORES); * bindings.add("context", DoubleValuesSource.fromQuery(new ConstantScoreQuery(myContextQuery, boost))); * Expression expr = JavascriptCompiler.compile("score * context"); * FunctionScoreQuery q = new FunctionScoreQuery(inputQuery, expr.getDoubleValuesSource(bindings)); * </pre> {noformat} ...even if that new code is just as efficient as the old code (Is it???) why make our users replace 1 line with 7? Why should a "novice" user who wants to use a simple concept like a "boosted query" need to dig into understanding "Expression Bindings" and ValueSources?? Why aren't we just refactoring the *internals* of classes like {{BoostingQuery}} so that they subclass FunctionScoreQuery and provide (simple) backcompat constructors? ---- Also: Why does this change flat out remove all the existing test code of these deprecated/removed classes? Even if the classes are being removed, shouldn't the eisting tests be refactored to assert that the "new" way of doing things (via FunctionScoreQuery) produces the same "expected" results? > Deprecate CustomScoreQuery, BoostedQuery and BoostingQuery > ---------------------------------------------------------- > > Key: LUCENE-8099 > URL: https://issues.apache.org/jira/browse/LUCENE-8099 > Project: Lucene - Core > Issue Type: Improvement > Reporter: Alan Woodward > Assignee: Alan Woodward > Priority: Minor > Fix For: 7.3 > > Attachments: LUCENE-8099.patch, LUCENE-8099.patch > > > After LUCENE-7998, these three queries can all be replaced by a > FunctionScoreQuery. Using lucene-expressions makes them much easier to use > as well. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org