lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Male (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3256) Consolidate CustomScoreQuery, ValueSourceQuery and BoostedQuery
Date Wed, 29 Jun 2011 22:16:28 GMT


Chris Male commented on LUCENE-3256:

I'm not sure if we should change the implementation of BoostedQuery to use CustomScoreQuery.
It's going to be slower as it goes through more levels of indirection. The edismax parser
creates BoostedQuery instances (as does the boost qparser), so this is going to be a heavily
used implementation and should be optimized. Having a specific BoosgtedQuery is even nicer
for debugging purposes where the toString is simpler and more specific.

Very valid point.  I will make BoostedQuery a 1st class construct.

Actually, looking closer at CustomScoreQuery, I don't even see why it's not more generic...
why does it require ValueSourceQueries and not just combine the scores of arbitrary queries?
It already just operates on scorers and doesn't seem to use value sources at all.

For the life of me I'm sure it used to do just that.  I'll open an issue to make the change.

Thanks for your review Yonik!

> Consolidate CustomScoreQuery, ValueSourceQuery and BoostedQuery 
> ----------------------------------------------------------------
>                 Key: LUCENE-3256
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Sub-task
>          Components: core/search
>            Reporter: Chris Male
>             Fix For: 4.0
>         Attachments: LUCENE-3256.patch, LUCENE-3256.patch
> Lucene's CustomScoreQuery and Solr's BoostedQuery do essentially the same thing: they
boost the scores of Documents by the value from a ValueSource.  BoostedQuery does this in
a direct fashion, by accepting a ValueSource. CustomScoreQuery on the other hand, accepts
a series of ValueSourceQuerys.  ValueSourceQuery seems to do exactly the same thing as FunctionQuery.
> With Lucene's ValueSource being deprecated / removed, we need to resolve these dependencies
and simplify the code.
> Therefore I recommend we do the following things:
> - Move CustomScoreQuery (and CustomScoreProvider) to the new Queries module and change
it over to use FunctionQuerys instead of ValueSourceQuerys.  
> - Deprecate Solr's BoostedQuery in favour of the new CustomScoreQuery.  CSQ provides
a lot of support for customizing the scoring process.
> - Move and consolidate all tests of CSQ and BoostedQuery, to the Queries module and have
them test CSQ instead.

This message is automatically generated by JIRA.
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message