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

Adrien Grand commented on LUCENE-6229:
--------------------------------------

OK, I think I understand. The new MinShouldMatchSumScorer advances sub scorers 
lazily until freq() or score() is called. I believe you are wrapping this 
min-should-match query into another query that does not propagate calls to 
freq() (like another boolean query?).

Note that you can work-around the issue by calling freq() on sub-scorers as 
well, but I wouldn't consider it a bug. This is exactly the kind of things that 
worries me about this API: there are assumptions that are made about this API 
that nothing else relies upon. And I think the min-should-match query is a good 
example: we know that there is a match as soon as we found minShouldMatch 
matching clauses. Forcefully trying to advance ALL clauses to the matching doc 
would be wasteful, which is why this scorer only does it when it is required, 
ie. when freq() or score() are called.

I think one acceptable middle ground would be to:
 - hide getChildren from the scorer that is passed to LeafCollector to remove 
the trap of calling getChildren on a scorer that does not support it 
(LUCENE-6228)
 - add a new IndexSearcher specializating that only uses scorers (not bulk 
scorers). Collectors called through this indexSearcher could cast the scorer 
that is passed in order to have access to children.

Stefan, Terry: what do you think?

> Remove Scorer.getChildren?
> --------------------------
>
>                 Key: LUCENE-6229
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6229
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Priority: Minor
>
> This API is used in a single place in our code base: 
> ToParentBlockJoinCollector. In addition, the usage is a bit buggy given that 
> using this API from a collector only works if setScorer is called with an 
> actual Scorer (and not eg. FakeScorer or BooleanScorer like you would get in 
> disjunctions) so it needs a custom IndexSearcher that does not use the 
> BulkScorer API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to