[ 
https://issues.apache.org/jira/browse/LUCENE-8099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16309384#comment-16309384
 ] 

Alan Woodward commented on LUCENE-8099:
---------------------------------------

Hi [~hossman]

I had a few reasons for wanting to do this:
* migrating from ValueSource to DoubleValuesSource - this makes BoostedQuery 
and CustomScoreQuery essentially the same as FunctionScoreQuery, with a 
specific source calculation.  CSQ has a clunky API that doesn't deal well with 
sparse value sources, so moving to expressions is much better (I think, at any 
rate)
* API name confusion.  We have BoostQuery, BoostedQuery and BoostingQuery - can 
you tell without checking the javadocs what each one does, and how it's 
different?
* Implementation consolidation, as you describe.

Re testing, replacement tests had already been committed as part of another 
issue, in TestFunctionScoreQuery.  BoostingQuery didn't have any functionality 
tests at all, just an equality check and a rewrite check, so the test coverage 
is actually more extensive now.

bq. why make our users replace 1 line with 7?

I agree this isn't great.  And in fact, looking again at the example javadoc, 
it doesn't correctly replace what BoostingQuery does.  Maybe we should add some 
static methods to FunctionScoreQuery to allow for simple boosting?  Something 
like:
{code}
Query boostedbyQuery = FunctionScoreQuery.boostByQuery(input, boostQuery, 
boostValue);
Query boostedByValue = FunctionScoreQuery.boostByValue(input, 
boostValuesSource);
{code}
Would that meet your concerns?

> 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

Reply via email to