[ https://issues.apache.org/jira/browse/LUCENE-850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523979 ]
Mike Klaas commented on LUCENE-850: ----------------------------------- Do address the issue above, the following needs to be added: =================================================================== --- build-src/java/solr/org/apache/lucene/search/CustomBoostQuery.java (revision 9312) +++ build-src/java/solr/org/apache/lucene/search/CustomBoostQuery.java (working copy) @@ -280,7 +280,7 @@ /*(non-Javadoc) @see org.apache.lucene.search.Scorer#score() */ public float score() throws IOException { - float boostScore = (boostScorer==null ? 1 : boostScorer.score()); + float boostScore = (boostScorer==null || subQueryScorer.doc() != boostScorer.doc() ? 1 : boos tScorer.score()); return qWeight * customScore(subQueryScorer.doc(), subQueryScorer.score(), boostScore); } @@ -300,7 +300,8 @@ return subQueryExpl; } // match - Explanation boostExpl = boostScorer==null ? null : boostScorer.explain(doc); + Explanation boostExpl = boostScorer==null ? null : + weight.qStrict ? boostScorer.explain(doc) : weight.boostWeight.explain(reader,doc); Explanation customExp = customExplain(doc,subQueryExpl,boostExpl); float sc = qWeight * customExp.getValue(); Explanation res = new ComplexExplanation( > Easily create queries that transform subquery scores arbitrarily > ---------------------------------------------------------------- > > Key: LUCENE-850 > URL: https://issues.apache.org/jira/browse/LUCENE-850 > Project: Lucene - Java > Issue Type: New Feature > Components: Search > Reporter: Mike Klaas > Attachments: CustomBoostQuery.java, prodscorer.patch.diff > > > Refactor DisMaxQuery into SubQuery(Query|Scorer) that admits easy > subclassing. An example is given for multiplicatively combining scores. > Note: patch is not clean; for demonstration purposes only. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]