You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2015/06/19 14:06:01 UTC
[jira] [Commented] (LUCENE-6587) Move explain() to Scorer
[ https://issues.apache.org/jira/browse/LUCENE-6587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14593366#comment-14593366 ]
Robert Muir commented on LUCENE-6587:
-------------------------------------
I am not sure it really helps duplicated code. Now instead of logic just in booleanweight, all N booleanscorers need special logic! And look at how complicated this can be for e.g. reqOptSumScorer.
I also do not think this method needs to be sped up or optimized. its for debugging. I would prefer we keep Scorer on the simple side.
> Move explain() to Scorer
> ------------------------
>
> Key: LUCENE-6587
> URL: https://issues.apache.org/jira/browse/LUCENE-6587
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Alan Woodward
> Attachments: LUCENE-6587.patch
>
>
> At the moment, the explanation API is on Weight, rather than on Scorer. This has a number of disadvantages:
> * It means that Weights need to know about the scoring algorithms of their child scorers, which results in a leaky API (for example, the SloppyPhraseScorer has a package-private sloppyFreq() method which is only used by PhraseWeight.explain(), and SpanScorer has a similar public method that is again only called by explanation functions)
> * It leads to lots of duplicated code - more or less every Weight.explain() method creates a Scorer, advances to the appropriate doc, and checks for a match
> * It's very slow, because we create a new Scorer for every document
> I'd like to try moving explain() directly to Scorer. We can keep the old slow IndexSearcher.explain() API, but in addition explanations could now be generated efficiently in a Collector.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org