Alan Woodward created LUCENE-6587:
-------------------------------------
Summary: 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
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: [email protected]
For additional commands, e-mail: [email protected]